diff options
author | Alban Gruin | 2017-09-08 11:53:49 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-08 11:53:49 +0200 |
commit | 57ffdbf0658042069abcf0b1f9184ff69a3139e2 (patch) | |
tree | 85ab2f0cf55fc85dec62b065b7eb246b7de46e4c /feeds.py | |
parent | 0a287c2013bcfd1cb71926fbd0835170369521f7 (diff) |
Ajout de l’année dans les urls
Diffstat (limited to 'feeds.py')
-rw-r--r-- | feeds.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -19,7 +19,7 @@ from django.utils.feedgenerator import SyndicationFeed from icalendar import Calendar, Event -from .models import Course, Group, Timetable +from .models import Course, Group, Timetable, Year from .templatetags.rooms import format_rooms ICAL_NAMES = ["summary", "description", "location", "start", "dtstart", "dtend"] @@ -48,9 +48,10 @@ class IcalFeed(Feed): feed_type = IcalFeedGenerator link = "" - def get_object(self, request, timetable_slug, group_slug): + def get_object(self, request, year_slug, timetable_slug, group_slug): try: - timetable = Timetable.objects.get(slug=timetable_slug) + year = Year.objects.get(slug=year_slug) + timetable = Timetable.objects.get(year=year, slug=timetable_slug) group = Group.objects.get(timetable=timetable, slug=group_slug) except: raise ObjectDoesNotExist |