diff options
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") |