-def list_published(request):
- division = 'published'
-
- objects = models.Audiobook.objects.exclude(Q(mp3_published=None) | Q(ogg_published=None))
- return render(request, "archive/list_published.html", locals())
+class AudiobookList(ListView):
+ def get_queryset(self):
+ qs = models.Audiobook.objects.all()
+ if 's' in self.request.GET:
+ qs = qs.annotate(s=SearchVector('title', 'slug')).filter(s=self.request.GET['s'])
+ return qs