diff options
author | Tom Willemse | 2013-05-09 20:07:49 +0200 |
---|---|---|
committer | Tom Willemse | 2013-05-09 20:07:49 +0200 |
commit | 15c5869b54e9a770b9abbeab1e990b713cdb1b3b (patch) | |
tree | 4aa805a44e8da93f4b0698520f16096d216d8ec3 /ryuslash/aggregator/feeds.py | |
parent | 5f7df695ac6dd9ccc5444a8fc20fa8d97196953e (diff) | |
download | ryuslash.org-15c5869b54e9a770b9abbeab1e990b713cdb1b3b.tar.gz ryuslash.org-15c5869b54e9a770b9abbeab1e990b713cdb1b3b.zip |
Update for django 1.4
Diffstat (limited to 'ryuslash/aggregator/feeds.py')
-rw-r--r-- | ryuslash/aggregator/feeds.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ryuslash/aggregator/feeds.py b/ryuslash/aggregator/feeds.py new file mode 100644 index 0000000..75e5d4f --- /dev/null +++ b/ryuslash/aggregator/feeds.py @@ -0,0 +1,23 @@ +from django.contrib.syndication.views import Feed + +from .models import Post + +class LatestPostsFeed(Feed): + title = "ryuslash's RSS feed" + link = "/" + description = "Updates by ryuslash" + + def items(self): + return Post.objects.all()[:20] + + def item_title(self, item): + return item.title + + def item_description(self, item): + return item.body + + def item_link(self, item): + return "/post/%d/" % item.pk + + def item_pubdate(self, item): + return item.updated |