X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/818b7ba3c373f6a10c70224d8650cdcbbd3bcd75..c73940c1babe80cf7a6dd46854dca1543905ae7a:/apps/catalogue/feeds.py diff --git a/apps/catalogue/feeds.py b/apps/catalogue/feeds.py old mode 100755 new mode 100644 index 8bb21c32..4884a4cd --- a/apps/catalogue/feeds.py +++ b/apps/catalogue/feeds.py @@ -8,11 +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