1 # -*- coding: utf-8 -*-
2 from django.contrib.syndication.views import Feed
3 from django.shortcuts import get_object_or_404
4 from catalogue.models import Book, Chunk
6 class PublishTrackFeed(Feed):
7 title = u"Planowane publikacje"
10 def description(self, obj):
11 return u"Publikacje, które dotarły co najmniej do etapu: %s" % obj.name
13 def get_object(self, request, slug):
14 return get_object_or_404(Chunk.tag_model, slug=slug)
17 return Book.objects.filter(public=True, _on_track__gte=obj.ordering
18 ).order_by('-_on_track', 'title')