Mercurial > public > sg101
diff gpp/news/feeds.py @ 1:dbd703f7d63a
Initial import of sg101 stuff from private repository.
author | gremmie |
---|---|
date | Mon, 06 Apr 2009 02:43:12 +0000 |
parents | |
children | 6f14970b103a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/news/feeds.py Mon Apr 06 02:43:12 2009 +0000 @@ -0,0 +1,28 @@ +""" +This file contains the feed classes for the news application. +""" + +from django.contrib.syndication.feeds import Feed +from news.models import Story + + +class LatestNewsFeed(Feed): + """The Feed class for the news application""" + + title = 'SurfGuitar101.com News Feed' + link = '/feeds/news/' + description = 'News articles and stories from SurfGuitar101.com' + copyright = 'Copyright (C) 2008, Brian Neal' + ttl = '720' + + title_template = 'news/feed_title.html' + description_template = 'news/feed_description.html' + + def items(self): + return Story.objects.order_by('-date_published')[:5] + + def item_pubdate(self, item): + return item.date_published + + def item_categories(self, item): + return (item.category.title, )