from django.db import models class ExamAttemptSection(models.Model): class Status(models.IntegerChoices): LOCKED = 0 AVAILABLE = 1 COMPLETED = 2 attempt = models.ForeignKey("labs.ExamAttempt", on_delete=models.CASCADE) section = models.ForeignKey("labs.ExamSection", on_delete=models.CASCADE) display_order = models.IntegerField(default=0) status = models.IntegerField(choices=Status.choices, default=Status.LOCKED) started_at = models.DateTimeField(null=True, blank=True) completed_at = models.DateTimeField(null=True, blank=True) class Meta: db_table = "exam_attempt_sections"