From ef6f5e8517436b804265880b71a2ee88f9f5c179 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sun, 26 Nov 2017 14:22:13 +0100 Subject: Récupération du semestre pour générer la liste des groupes. --- models.py | 2 +- views.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/models.py b/models.py index 0904b63..25ddd1b 100644 --- a/models.py +++ b/models.py @@ -164,7 +164,7 @@ class CourseManager(Manager): .order_by("groups__name", "year", "week") \ .annotate(year=ExtractYear("begin"), week=ExtractWeek("begin")) \ - .values("groups__mention", + .values("groups__mention", "groups__semester", "groups__subgroup", "year", "week") diff --git a/views.py b/views.py index 5eb224e..4431891 100644 --- a/views.py +++ b/views.py @@ -47,6 +47,7 @@ def group_list(request, year_slug, timetable_slug): for group in groups: for group_week in groups_weeks: if group.corresponds_to(group_week["groups__mention"], + group_week["groups__semester"], group_week["groups__subgroup"]): if not hasattr(group, "weeks"): group.weeks = [] -- cgit v1.2.1