aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-01-22 12:37:56 +0100
committerAlban Gruin2017-01-22 12:37:56 +0100
commit310c91fcd777a9e7c97379803e41d795a4661be7 (patch)
tree8da131dceeb256ce2555b88fcd43a48fa27c794f /models.py
parent3f0efad5ee4069d5387e742f346f8d782607fa96 (diff)
Stockage de la date de dernière mise à jour d'un emploi du temps par semaine et année
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")