diff options
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -62,7 +62,14 @@ class Source(models.Model): verbose_name_plural = "sources d’emploi du temps" +class TimetableManager(Manager): + def get_queryset(self): + return super(Manager, self).get_queryset().select_related("year") + + class Timetable(SlugModel): + objects = TimetableManager() + year = models.ForeignKey(Year, on_delete=models.CASCADE, verbose_name="année") name = models.CharField(max_length=64, verbose_name="nom") |