generalise a QuestionBase

This commit is contained in:
Ross
2023-06-05 09:10:54 +01:00
parent ac558b9ea2
commit e0723d4d3a
8 changed files with 177 additions and 141 deletions
+3 -5
View File
@@ -12,7 +12,7 @@ from django.utils.translation import gettext_lazy as _
from sortedm2m.fields import SortedManyToManyField
from generic.models import CidUser, CidUserGroup, ExamBase, ExamUserStatus, QuestionNote, UserAnswerBase, UserUserGroup
from generic.models import CidUser, CidUserGroup, ExamBase, ExamUserStatus, QuestionBase, QuestionNote, UserAnswerBase, UserUserGroup
import reversion
@@ -24,7 +24,7 @@ class Category(models.Model):
return self.category
class Question(models.Model):
class Question(QuestionBase):
stem = models.TextField(
blank=False,
help_text="Stem of the question",
@@ -82,8 +82,6 @@ class Question(models.Model):
help_text="Feedback for answer",
)
created_date = models.DateTimeField(default=timezone.now)
author = models.ManyToManyField(
settings.AUTH_USER_MODEL,
blank=True,
@@ -95,7 +93,7 @@ class Question(models.Model):
Category, on_delete=models.SET_NULL, null=True, blank=True
)
notes = GenericRelation(QuestionNote)
#notes = GenericRelation(QuestionNote)
def __str__(self):
return self.stem