generalise a QuestionBase
This commit is contained in:
+3
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user