diff options
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 18 |
1 files changed, 0 insertions, 18 deletions
@@ -62,24 +62,6 @@ class Timetable(SlugModel): 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") - - updated_at = models.DateTimeField(verbose_name="date de publication", null=True) - - def __str__(self): - return "{0}, semaine {1} de {2}".format(self.timetable, self.week, self.year) - - - class Meta: - unique_together = ("timetable", "week", "year",) - verbose_name = "dernière mise à jour" - verbose_name_plural = "dernières mises à jour" - - class GroupManager(Manager): def get_relevant_groups(self, *args, **criteria): return self.get_queryset().filter(*args, **criteria).annotate(children_count=Count("children")).filter(children_count=0) |