diff options
author | Alban Gruin | 2017-09-24 17:16:10 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-24 17:16:10 +0200 |
commit | e30b0c673cae607175c5bae6df6e87d8b100bdf3 (patch) | |
tree | 2ffc269ad5e56ff93e2ecd3bded5843a585c4fe7 /models.py | |
parent | 77748ec01d1ef59d8436597a9b52675b309e1c4d (diff) |
Suppression du modèle LastUpdate, utilisation du champ last_update à
la place.
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) |