All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m29s
19 lines
606 B
Python
19 lines
606 B
Python
from django.db import models
|
|
from .course_model import Course
|
|
|
|
|
|
class Exam(models.Model):
|
|
course = models.ForeignKey(Course, on_delete=models.CASCADE, related_name='exams')
|
|
date = models.DateField()
|
|
name = models.CharField(max_length=200, blank=True) # e.g., "2022-01-15"
|
|
folder_path = models.CharField(max_length=500, blank=True) # Path to exam folder in content
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
class Meta:
|
|
unique_together = ['course', 'date']
|
|
ordering = ['-date']
|
|
|
|
def __str__(self):
|
|
return f"{self.course.name} - {self.date}"
|
|
|