1 from django
.contrib
.syndication
.feeds
import Feed
2 from archweb_dev
.packages
.models
import Package
3 from archweb_dev
.news
.models
import News
4 #from datetime import datetime
6 class PackageFeed(Feed
):
7 title
= 'Recent Package Updates'
9 description
= 'Recent Package Updates'
12 return Package
.objects
.order_by('-last_update')[:10]
14 def item_pubdate(self
, item
):
15 return item
.last_update
17 def item_categories(self
, item
):
18 return (item
.repo
.name
,item
.category
.category
)
21 title
= 'Recent News Updates'
23 description
= 'Recent News Updates'
26 return News
.objects
.order_by('-postdate', '-id')[:10]
28 def item_pubdate(self
, item
):
31 def item_author_name(self
, item
):
32 return item
.author
.get_full_name()