euscanwww/feed: tweak feeds

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
Corentin Chary 2011-08-28 10:45:46 +02:00
parent 60bc61275e
commit 45ca837908

View File

@ -9,7 +9,9 @@ from euscan.views import *
class BaseFeed(Feed): class BaseFeed(Feed):
feed_type = Atom1Feed feed_type = Atom1Feed
author = 'euscan' author_name = 'euscan'
item_author_name = author_name
ttl = 3600
def item_title(self, vlog): def item_title(self, vlog):
return str(vlog) return str(vlog)
@ -21,7 +23,7 @@ class BaseFeed(Feed):
else: else:
txt = 'Version %s of package %s ' % (vlog.version, vlog.package) txt = 'Version %s of package %s ' % (vlog.version, vlog.package)
if vlog.action == vlog.VERSION_REMOVED: if vlog.action == vlog.VERSION_REMOVED:
if vlog.overlay: if not vlog.overlay:
txt += 'has been removed upstream' txt += 'has been removed upstream'
else: else:
txt += 'has been removed from overlay "%s"' % vlog.overlay txt += 'has been removed from overlay "%s"' % vlog.overlay
@ -53,8 +55,7 @@ class GlobalFeed(BaseFeed):
return [ category['category'] for category in categories ] return [ category['category'] for category in categories ]
def items(self): def items(self):
return VersionLog.objects.order_by('-id')[:30] return VersionLog.objects.order_by('-id')[:250]
class PackageFeed(BaseFeed): class PackageFeed(BaseFeed):
feed_type = Atom1Feed feed_type = Atom1Feed
@ -100,7 +101,7 @@ class MaintainerFeed(BaseFeed):
def items(self, maintainer): def items(self, maintainer):
q = VersionLog.objects.filter(package__maintainers__id=maintainer.id) q = VersionLog.objects.filter(package__maintainers__id=maintainer.id)
return q.order_by('-id')[:30] return q.order_by('-id')[:50]
class HerdFeed(BaseFeed): class HerdFeed(BaseFeed):
feed_type = Atom1Feed feed_type = Atom1Feed
@ -122,7 +123,7 @@ class HerdFeed(BaseFeed):
def items(self, herd): def items(self, herd):
q = VersionLog.objects.filter(package__herds__id=herd.id) q = VersionLog.objects.filter(package__herds__id=herd.id)
return q.order_by('-id')[:30] return q.order_by('-id')[:100]
class CategoryFeed(BaseFeed): class CategoryFeed(BaseFeed):
feed_type = Atom1Feed feed_type = Atom1Feed
@ -143,4 +144,4 @@ class CategoryFeed(BaseFeed):
def items(self, category): def items(self, category):
q = VersionLog.objects.filter(package__category=category) q = VersionLog.objects.filter(package__category=category)
return q.order_by('-id')[:30] return q.order_by('-id')[:100]