aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'models.py')
-rw-r--r--models.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/models.py b/models.py
index 13ae3f4..d01dbf0 100644
--- a/models.py
+++ b/models.py
@@ -17,6 +17,19 @@ class Timetable(models.Model):
verbose_name_plural = "emplois du temps"
+class LastUpdate(models.Model):
+ timetable = models.ForeignKey(Timetable, on_delete=models.CASCADE, verbose_name="emploi du temps")
+ week = models.IntegerField(verbose_name="semaine")
+ year = models.IntegerField(verbose_name="année")
+ date = models.DateTimeField(verbose_name="date de mise à jour")
+
+
+ class Meta:
+ unique_together = ("timetable", "week", "year",)
+ verbose_name = "dernière mise à jour"
+ verbose_name_plural = "dernières mises à jour"
+
+
class Group(models.Model):
name = models.CharField(max_length=255, verbose_name="nom")
timetable = models.ForeignKey(Timetable, on_delete=models.CASCADE, verbose_name="emploi du temps")