diff options
author | Alban Gruin | 2017-09-08 00:18:21 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-08 00:18:21 +0200 |
commit | 0a287c2013bcfd1cb71926fbd0835170369521f7 (patch) | |
tree | df287f4d1a1e31d1203bbda50db6252d5ff135e6 /views.py | |
parent | 6afd8035bc4b89f5b50320167c23274ebec86355 (diff) |
Simplification du traitement des semaines
Diffstat (limited to 'views.py')
-rw-r--r-- | views.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -36,15 +36,15 @@ def mention_list(request, year_slug): def group_list(request, year_slug, timetable_slug): get_object_or_404(Year, slug=year_slug) timetable = get_object_or_404(Timetable, slug=timetable_slug) - groups = Group.objects.get_relevant_groups().order_by("name") + groups = Group.objects.get_relevant_groups(timetable=timetable).order_by("name") year, week = get_current_week() start, _ = get_week(year, week) - groups_weeks = Course.objects.get_weeks(begin__gte=start).values("group__timetable", "groups__mention", "groups__subgroup", "groups__td", "groups__tp", "year", "week") + groups_weeks = Course.objects.get_weeks(begin__gte=start, timetable=timetable).values("groups__mention", "groups__subgroup", "groups__td", "groups__tp", "year", "week") for group in groups: for group_week in groups_weeks: - if group.corresponds_to(group_week["groups__timetable"], group_week["groups__mention"], group_week["groups__subgroup"], group_week["groups__td"], group_week["groups__tp"]): + if group.corresponds_to(timetable.id, group_week["groups__mention"], group_week["groups__subgroup"], group_week["groups__td"], group_week["groups__tp"]): if not hasattr(group, "weeks"): group.weeks = [] |