diff options
author | Alban Gruin | 2017-09-27 15:06:54 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-27 15:06:54 +0200 |
commit | 436099ebef2acb8a3965cc39b07d99f61fa1eba2 (patch) | |
tree | 20e7ec165fd798c36c32f2d053743391f3cbd53c /views.py | |
parent | a43f7fa835fcdf9f591c3f759f5ab7545c9df5b3 (diff) |
Suppression des lignes trop longues
Diffstat (limited to 'views.py')
-rw-r--r-- | views.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -37,11 +37,15 @@ def group_list(request, year_slug, timetable_slug): year, week = get_current_week() start, _ = get_week(year, week) - groups_weeks = Course.objects.get_weeks(begin__gte=start, timetable=timetable).values("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(timetable.id, 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 = [] @@ -68,7 +72,8 @@ def timetable(request, year_slug, timetable_slug, group_slug, year=None, week=No timetable = get_object_or_404(Timetable, year__slug=year_slug, slug=timetable_slug) group = get_object_or_404(Group, slug=group_slug, timetable=timetable) - courses = Course.objects.get_courses_for_group(group, begin__gte=start, begin__lt=end).annotate(Max("last_update")) + courses = Course.objects.get_courses_for_group(group, begin__gte=start, begin__lt=end) \ + .annotate(Max("last_update")) if courses.count() == 0: raise Http404 |