def catalogue(request):
return render(request, 'catalogue/catalogue.html', {
- 'books': Book.objects.filter(parent=None),
+ 'books': Book.objects.filter(findable=True, parent=None),
'pictures': Picture.objects.all(),
'collections': Collection.objects.all(),
'active_menu_item': 'all_works',
def literature(request):
- books = Book.objects.filter(parent=None)
+ books = Book.objects.filter(parent=None, findable=True)
return object_list(request, books, related_tags=get_top_level_related_tags([]))
def audiobooks(request):
- audiobooks = Book.objects.filter(media__type__in=('mp3', 'ogg')).distinct()
+ audiobooks = Book.objects.filter(findable=True, media__type__in=('mp3', 'ogg')).distinct()
return object_list(request, audiobooks, list_type='audiobooks', extra={
- 'daisy': Book.objects.filter(media__type='daisy').distinct(),
+ 'daisy': Book.objects.filter(findable=True, media__type='daisy').distinct(),
})
# TODO: Pictures on shelves not supported yet.
books = Book.tagged.with_all(shelf_tags).order_by()
fragments = fragments.filter(Q(book__in=books) | Q(book__ancestor__in=books))
+ else:
+ fragments = fragments.filter(book__findable=True)
if not fragments and len(tags) == 1 and list_type == 'books':
if PictureArea.tagged.with_any(tags).exists() or Picture.tagged.with_any(tags).exists():
if any(tag.category == 'set' for tag in tags):
params = {'objects': books}
else:
+ books = books.filter(findable=True)
params = {
- 'objects': Book.tagged_top_level(tags),
+ 'objects': Book.tagged_top_level(tags).filter(findable=True),
'fragments': Fragment.objects.filter(book__in=books),
'related_tags': get_top_level_related_tags(tags),
}
elif list_type == 'gallery':
params = {'objects': Picture.tagged.with_all(tags)}
elif list_type == 'audiobooks':
- audiobooks = Book.objects.filter(media__type__in=('mp3', 'ogg')).distinct()
+ audiobooks = Book.objects.filter(findable=True, media__type__in=('mp3', 'ogg')).distinct()
params = {
'objects': Book.tagged.with_all(tags, audiobooks),
'extra': {