From 712dc72249211f1df442de8b8a40d2cc397dac76 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 16 Mar 2012 16:35:41 +0100 Subject: [PATCH] published flag for tracking --- apps/catalogue/feeds.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/catalogue/feeds.py b/apps/catalogue/feeds.py index a185ae39..4884a4cd 100755 --- a/apps/catalogue/feeds.py +++ b/apps/catalogue/feeds.py @@ -8,14 +8,22 @@ class PublishTrackFeed(Feed): link = "/" def description(self, obj): - return u"Publikacje, które dotarły co najmniej do etapu: %s" % obj.name + tag, published = obj + return u"Publikacje, które dotarły co najmniej do etapu: %s" % tag.name def get_object(self, request, slug): - return get_object_or_404(Chunk.tag_model, slug=slug) + published = request.GET.get('published') + if published is not None: + published = published == 'true' + return get_object_or_404(Chunk.tag_model, slug=slug), published def item_title(self, item): return item.title def items(self, obj): - return Book.objects.filter(public=True, _on_track__gte=obj.ordering + tag, published = obj + books = Book.objects.filter(public=True, _on_track__gte=tag.ordering ).order_by('-_on_track', 'title') + if published is not None: + books = books.filter(_published=published) + return books -- 2.20.1