annotate gpp/news/feeds.py @ 45:a5b4c5ce0658

Breaking down and controlling all media files, including javascript libraries.
author Brian Neal <bgneal@gmail.com>
date Fri, 19 Jun 2009 03:16:03 +0000
parents dbd703f7d63a
children 6f14970b103a
rev   line source
gremmie@1 1 """
gremmie@1 2 This file contains the feed classes for the news application.
gremmie@1 3 """
gremmie@1 4
gremmie@1 5 from django.contrib.syndication.feeds import Feed
gremmie@1 6 from news.models import Story
gremmie@1 7
gremmie@1 8
gremmie@1 9 class LatestNewsFeed(Feed):
gremmie@1 10 """The Feed class for the news application"""
gremmie@1 11
gremmie@1 12 title = 'SurfGuitar101.com News Feed'
gremmie@1 13 link = '/feeds/news/'
gremmie@1 14 description = 'News articles and stories from SurfGuitar101.com'
gremmie@1 15 copyright = 'Copyright (C) 2008, Brian Neal'
gremmie@1 16 ttl = '720'
gremmie@1 17
gremmie@1 18 title_template = 'news/feed_title.html'
gremmie@1 19 description_template = 'news/feed_description.html'
gremmie@1 20
gremmie@1 21 def items(self):
gremmie@1 22 return Story.objects.order_by('-date_published')[:5]
gremmie@1 23
gremmie@1 24 def item_pubdate(self, item):
gremmie@1 25 return item.date_published
gremmie@1 26
gremmie@1 27 def item_categories(self, item):
gremmie@1 28 return (item.category.title, )