aboutsummaryrefslogtreecommitdiff
path: root/feeds.py
diff options
context:
space:
mode:
authorAlban Gruin2017-09-25 15:39:05 +0200
committerAlban Gruin2017-09-25 15:39:05 +0200
commit701e3d62efe34a0b6b0a599238175704196097de (patch)
tree921475bba1079d7dd805328aa22dcac6f7bb365d /feeds.py
parent89bc69f85d9ed2c697db58dc742c4129283f755b (diff)
Correction des flux RSS et Atom : update était à l’origine un objet,
c’est maintenant un dictionnaire.
Diffstat (limited to 'feeds.py')
-rw-r--r--feeds.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/feeds.py b/feeds.py
index 7e8cd80..19c9e47 100644
--- a/feeds.py
+++ b/feeds.py
@@ -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]