Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
0:900ba3c7b765 | 1:dbd703f7d63a |
---|---|
1 """ | |
2 This file contains the feed classes for the news application. | |
3 """ | |
4 | |
5 from django.contrib.syndication.feeds import Feed | |
6 from news.models import Story | |
7 | |
8 | |
9 class LatestNewsFeed(Feed): | |
10 """The Feed class for the news application""" | |
11 | |
12 title = 'SurfGuitar101.com News Feed' | |
13 link = '/feeds/news/' | |
14 description = 'News articles and stories from SurfGuitar101.com' | |
15 copyright = 'Copyright (C) 2008, Brian Neal' | |
16 ttl = '720' | |
17 | |
18 title_template = 'news/feed_title.html' | |
19 description_template = 'news/feed_description.html' | |
20 | |
21 def items(self): | |
22 return Story.objects.order_by('-date_published')[:5] | |
23 | |
24 def item_pubdate(self, item): | |
25 return item.date_published | |
26 | |
27 def item_categories(self, item): | |
28 return (item.category.title, ) |