From fb9aee0fcc690b96ccfb8a5d7d587e6a771a563c Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Wed, 6 Sep 2017 12:40:30 +0200 Subject: Ajout des champs « active » et « checked » au modèle de cours, qui sera nécessaire pour la fonction de mise à jour sans tout jeter. Les cours avec active à False ne seront pas affichés. Il faudrait peut-être rajouter un index sur ce champ ? --- views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'views.py') diff --git a/views.py b/views.py index 176f174..ebe111b 100644 --- a/views.py +++ b/views.py @@ -29,7 +29,7 @@ def index(request): year, week = get_current_week() start, _ = get_week(year, week) - groups_weeks = Course.objects.get_weeks(begin__gte=start).values("groups__timetable", "groups__mention", "groups__subgroup", "groups__td", "groups__tp", "year", "week") + groups_weeks = Course.objects.get_weeks(begin__gte=start, active=True).values("groups__timetable", "groups__mention", "groups__subgroup", "groups__td", "groups__tp", "year", "week") for group in groups: for group_week in groups_weeks: @@ -55,7 +55,7 @@ def timetable(request, timetable_slug, group_slug, year=None, week=None): timetable = get_object_or_404(Timetable, slug=timetable_slug) group = get_object_or_404(Group, slug=group_slug, timetable=timetable) last_update = get_object_or_404(LastUpdate, timetable=timetable, week=week, year=year) - courses = Course.objects.get_courses_for_group(group, begin__gte=start, begin__lt=end) + courses = Course.objects.get_courses_for_group(group, begin__gte=start, begin__lt=end, active=True) grouped_courses = group_courses(courses) -- cgit v1.2.1