From a4750ca6ad789432fffd60266a38b8586994c3d6 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 29 Dec 2011 10:34:20 +0100 Subject: [PATCH 1/1] feed fix --- apps/catalogue/feeds.py | 3 +++ apps/catalogue/models/book.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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) -- 2.20.1