aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
authorAlban Gruin2017-09-07 22:40:57 +0200
committerAlban Gruin2017-09-07 22:40:57 +0200
commit36b4c60aacae827b5ff8b6125bdfd70d7cf2a3a0 (patch)
treeea056fedf7819b9342e02d44b48f0dd89229deee /views.py
parentf18b2cc4f4aa7b2ed2d7801c19ddf75acbb6abc2 (diff)
J’ai fait des trucs mais je me suis rendu compte que c’est pas
terrible, du coup je fais un commit tout pété mais ça va vite changer vous inquiétez pas.
Diffstat (limited to 'views.py')
-rw-r--r--views.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/views.py b/views.py
index 363fddb..141dde8 100644
--- a/views.py
+++ b/views.py
@@ -32,9 +32,9 @@ def mention_list(request, year):
timetables = Timetable.objects.order_by("name").filter(year=year)
return render(request, "mention_list.html", {"year": year, "timetables": timetables})
-def timetables_list(request):
- timetables = Timetable.objects.order_by("name")
- groups = Group.objects.get_relevant_groups().order_by("name")
+def group_list(request, year, timetable_slug):
+ timetable = get_object_or_404(Timetable, slug=timetable_slug)
+ groups = Group.objects.get_relevant_groups(timetable=timetable).order_by("name")
year, week = get_current_week()
start, _ = get_week(year, week)
@@ -53,7 +53,7 @@ def timetables_list(request):
if hasattr(group, "weeks"):
group.weeks.sort()
- return render(request, "timetables_list.html", {"timetables": timetables, "groups": groups})
+ return render(request, "group_list.html", {"timetables": timetables, "groups": groups})
def timetable(request, timetable_slug, group_slug, year=None, week=None):
if year is None or week is None: