diff options
author | Alban Gruin | 2017-09-25 15:39:05 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-25 15:39:05 +0200 |
commit | 701e3d62efe34a0b6b0a599238175704196097de (patch) | |
tree | 921475bba1079d7dd805328aa22dcac6f7bb365d | |
parent | 89bc69f85d9ed2c697db58dc742c4129283f755b (diff) |
Correction des flux RSS et Atom : update était à l’origine un objet,
c’est maintenant un dictionnaire.
-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] |