From 61476fdb5c9fb9ff502d93e86f0277c8f024c81e Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Mon, 14 Jul 2014 11:03:54 -0400 Subject: [PATCH] First attempt to follow Django 1.4 feed classes. I followed the instructions at https://docs.djangoproject.com/en/1.4/ref/contrib/syndication/ and attempted to get these feeds to match that one. --- www/conservancy/feeds.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/www/conservancy/feeds.py b/www/conservancy/feeds.py index 9431810a..2c244f8f 100644 --- a/www/conservancy/feeds.py +++ b/www/conservancy/feeds.py @@ -42,6 +42,11 @@ class PressReleaseFeed(Feed): def items(self): return PressRelease.objects.filter(pub_date__lte=datetime.now(), sites__id__exact=settings.SITE_ID).order_by('-pub_date')[:10] + def item_title(self, item): + return item.title + + def item_description(self, item): + return item.title def item_pubdate(self, item): return item.pub_date @@ -76,6 +81,12 @@ class OmnibusFeed(ConservancyFeedBase): author_link = "https://sfconservancy.org/" author_name = "Software Freedom Conservancy" + def item_title(self, item): + return item.title + + def item_description(self, item): + return item.description + def item_enclosure_mime_type(self): return "audio/mpeg" def item_enclosure_url(self, item): @@ -199,6 +210,12 @@ class BlogFeed(ConservancyFeedBase): return answer + def item_title(self, item): + return item.title + + def item_description(self, item): + return item.description + def item_author_name(self, item): return item.author.formal_name