From: Radek Czajka Date: Thu, 29 Dec 2011 09:34:20 +0000 (+0100) Subject: feed fix X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/a4750ca6ad789432fffd60266a38b8586994c3d6?ds=sidebyside feed fix --- diff --git a/apps/catalogue/feeds.py b/apps/catalogue/feeds.py index 8bb21c32..a185ae39 100755 --- a/apps/catalogue/feeds.py +++ b/apps/catalogue/feeds.py @@ -13,6 +13,9 @@ class PublishTrackFeed(Feed): def get_object(self, request, slug): return get_object_or_404(Chunk.tag_model, slug=slug) + def item_title(self, item): + return item.title + def items(self, obj): return Book.objects.filter(public=True, _on_track__gte=obj.ordering ).order_by('-_on_track', 'title') diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 71547755..89c6267c 100755 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -271,7 +271,8 @@ class Book(models.Model): def get_on_track(self): if self.published: return -1 - stages = [ch.stage.ordering for ch in self if ch.stage is not None] + stages = [ch.stage.ordering if ch.stage is not None else 0 + for ch in self] if not len(stages): return 0 return min(stages)