diff options
Diffstat (limited to 'feeds.py')
-rw-r--r-- | feeds.py | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -103,14 +103,22 @@ class RSSFeed(Feed): return "Emploi du temps du groupe {0}".format(obj[0]) def item_link(self, item): - group = item.group - return reverse("timetable", kwargs={"year_slug": group.timetable.year.slug, "timetable_slug": group.timetable.slug, "group_slug": group.slug, "year": item.year, "week": item.week}) + group = item["group"] + return reverse("timetable", + kwargs={"year_slug": group.timetable.year.slug, + "timetable_slug": group.timetable.slug, + "group_slug": group.slug, + "year": item["year"], + "week": item["week"]}) def item_description(self, item): - return item.description + return item["description"] + + def item_title(self, item): + return "{0}, semaine {1} de {2}".format(item["group"], item["week"], item["year"]) def item_updateddate(self, item): - return item.date + return item["last_update__max"] def items(self, obj): template = loader.get_template("timetable_common.html") @@ -121,8 +129,8 @@ class RSSFeed(Feed): courses = Course.objects.get_courses_for_group(group, begin__gte=start, begin__lt=end) context = {"group": group, "courses": group_courses(courses), "last_update": update["last_update__max"], "year": update["year"], "week": update["week"]} - update.group = group - update.description = template.render(context) + update["group"] = group + update["description"] = template.render(context) return obj[1] |