diff options
author | Alban Gruin | 2017-01-28 13:27:32 +0100 |
---|---|---|
committer | Alban Gruin | 2017-01-28 13:27:32 +0100 |
commit | d5c846ac3214efcbd2b3cb8d562b58006c3a5eb5 (patch) | |
tree | 4e4721c0cdec315471379692f2f540b7a6c24851 /views.py | |
parent | cfd2969cd9fa18e6148e97c1066341b1c1add6cf (diff) | |
parent | ebb7c3bf0dc3eef2efa3f4add60ccfc7dc063248 (diff) |
Merge branch 'dev/db-groupby' into dev/dbv0.2.0
Diffstat (limited to 'views.py')
-rw-r--r-- | views.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -18,15 +18,15 @@ def index(request): current_year, current_week, _ = timezone.now().isocalendar() start, _ = get_week(current_year, current_week) - groups_weeks = Course.objects.get_weeks(start) + groups_weeks = Course.objects.get_weeks(begin__gte=start).values("groups__timetable", "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.timetable_id, group_week.mention, group_week.subgroup, group_week.td, group_week.tp): + 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 not hasattr(group, "weeks"): group.weeks = [] - date, _ = get_week(group_week.year, group_week.week) + date, _ = get_week(group_week["year"], group_week["week"]) if date not in group.weeks: group.weeks.append(date) |