feeds use manager

This commit is contained in:
volpino 2012-05-05 10:30:09 +02:00
parent 7ad08128cd
commit 5c0dbe11f2

View File

@ -53,7 +53,7 @@ class GlobalFeed(BaseFeed):
description = "Last euscan changes" description = "Last euscan changes"
def categories(self): def categories(self):
categories = Package.objects.values('category').distinct() categories = Package.objects.categories()
return [category['category'] for category in categories] return [category['category'] for category in categories]
def items(self): def items(self):
@ -128,7 +128,7 @@ class CategoryFeed(BaseFeed):
feed_type = Atom1Feed feed_type = Atom1Feed
def get_object(self, request, category): def get_object(self, request, category):
if not Package.objects.filter(category=category).count(): if not Package.objects.categories().count():
raise FeedDoesNotExist raise FeedDoesNotExist
return category return category