diff options
author | Alban Gruin | 2017-01-22 12:37:56 +0100 |
---|---|---|
committer | Alban Gruin | 2017-01-22 12:37:56 +0100 |
commit | 310c91fcd777a9e7c97379803e41d795a4661be7 (patch) | |
tree | 8da131dceeb256ce2555b88fcd43a48fa27c794f /models.py | |
parent | 3f0efad5ee4069d5387e742f346f8d782607fa96 (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.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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") |