migrate rapids

This commit is contained in:
Ross
2024-02-17 23:01:43 +00:00
parent 0bc2830ea2
commit 3a52855eb7
5 changed files with 72 additions and 10 deletions
+10 -1
View File
@@ -601,12 +601,21 @@ class RapidCreationDefault(models.Model):
def get_absolute_url(self):
return reverse("rapids:rapid_create")
class ExamQuestionDetail(models.Model):
exam = models.ForeignKey("Exam", on_delete=models.CASCADE)
rapid = models.ForeignKey(Rapid, on_delete=models.CASCADE)
sort_order = models.IntegerField(default=1000)
class Meta:
ordering = ("sort_order",)
# @reversion.register
class Exam(ExamBase):
app_name = "rapids"
exam_questions = SortedManyToManyField(Rapid, related_name="exams", blank="true")
#exam_questions = SortedManyToManyField(Rapid, related_name="exams", blank="true")
exam_questions = models.ManyToManyField(Rapid, through=ExamQuestionDetail, related_name="exams")
time_limit = models.IntegerField(
help_text="Exam time limit (in seconds). Default is 2100 secondse (35 minutes)",