django-cats/cats/models.py

152 lines
5.1 KiB
Python
Raw Normal View History

# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from django.db import models
class TopicType(models.Model):
text = models.CharField(max_length=255)
class Topic(models.Model):
topic = models.CharField(unique=True, max_length=50, db_comment="Thema")
active = models.IntegerField()
number_of_questions = models.IntegerField(
db_column="numOfQu"
) # Field name made lowercase.
percentage = models.IntegerField()
lang = models.CharField(max_length=42, blank=True, null=True)
topic_type = models.ForeignKey(TopicType, on_delete=models.CASCADE)
class Meta:
verbose_name = "Topic"
class QuestionType(models.Model):
class Meta:
verbose_name = "Question Type"
class QuestionTypeName(models.Model):
question_type = models.ForeignKey(QuestionType, on_delete=models.CASCADE)
lang = models.CharField(max_length=5)
name = models.CharField(max_length=25)
class Meta:
verbose_name = "Question Type Name"
unique_together = (("question_type", "lang"),)
class Question(models.Model):
question_type = models.ForeignKey(QuestionType, on_delete=models.CASCADE)
topic = models.ForeignKey(Topic, on_delete=models.CASCADE)
question = models.TextField(db_comment="Frage")
active = models.CharField(max_length=1)
description = models.CharField(max_length=1)
reference_question = models.ForeignKey(
"Question",
related_name="referenced",
on_delete=models.CASCADE,
null=True,
blank=True,
)
translation_status = models.IntegerField(blank=True, null=True)
explanation = models.TextField(blank=True)
class Meta:
verbose_name = "Question"
class Answer(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
answer = models.TextField()
correct = models.BooleanField(default=False)
reference_answer = models.ForeignKey(
"Answer",
related_name="referenced",
on_delete=models.CASCADE,
null=True,
blank=True,
)
class User(models.Model):
user_id = models.CharField(
primary_key=True, max_length=10
) # The composite primary key (user_id, root) found, that is not supported. The first column is selected.
cn_name = models.CharField(
db_column="CN_name", max_length=100
) # Field name made lowercase.
lang = models.CharField(max_length=2)
admin = models.CharField(max_length=1)
email = models.CharField(max_length=100)
send_certificate = models.CharField(
db_column="sendCert", max_length=13
) # Field name made lowercase.
root = models.CharField(max_length=45)
class Meta:
unique_together = (("user_id", "root"),)
class UserAddress(models.Model):
user_id = models.CharField(
primary_key=True, max_length=10
) # The composite primary key (user_id, root) found, that is not supported. The first column is selected.
root = models.CharField(max_length=45)
firstname = models.CharField(max_length=25)
lastname = models.CharField(max_length=25)
street = models.CharField(max_length=50)
house_number = models.CharField(max_length=5)
zipcode = models.CharField(max_length=10)
city = models.CharField(max_length=30)
state = models.CharField(max_length=50)
country = models.CharField(max_length=50)
class Meta:
unique_together = (("user_id", "root"),)
class LearnProgress(models.Model):
user_id = models.CharField(max_length=15)
root = models.CharField(max_length=45)
date = models.DateTimeField(db_comment="Uhrzeit und Datum")
t_id = models.IntegerField(db_comment="Themen ID")
number = models.IntegerField(db_comment="Anzahl der Fragen")
correct = models.IntegerField(db_comment="Richtige Fragen")
wrong = models.IntegerField(db_comment="Anzahl der falschen Antworten")
percentage = models.DecimalField(
max_digits=5, decimal_places=0, blank=True, null=True
)
uploaded = models.IntegerField(blank=True, null=True)
passed = models.IntegerField()
class IncorrectAnswer(models.Model):
lp_id = models.IntegerField(
primary_key=True
) # The composite primary key (lp_id, q_id) found, that is not supported. The first column is selected.
q_id = models.IntegerField()
class Meta:
unique_together = (("lp_id", "q_id"),)
class SchemaVersion(models.Model):
version = models.IntegerField(unique=True)
when = models.DateTimeField()
class Statistics(models.Model):
q_id = models.IntegerField(db_comment="Frage Id")
count = models.IntegerField(db_comment="Zählen von Antworten")
class Temp(models.Model):
uid = models.CharField(max_length=10, blank=True, null=True)
number = models.IntegerField(blank=True, null=True)