fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
740407e
)
filter by tags
author
Jan Szejko
<janek37@gmail.com>
Fri, 8 Dec 2017 13:43:28 +0000
(14:43 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Fri, 8 Dec 2017 13:43:28 +0000
(14:43 +0100)
src/api/handlers.py
patch
|
blob
|
history
diff --git
a/src/api/handlers.py
b/src/api/handlers.py
index
b8eec2f
..
97b82fc
100644
(file)
--- a/
src/api/handlers.py
+++ b/
src/api/handlers.py
@@
-312,6
+312,13
@@
class FilterBooksHandler(AnonymousBooksHandler):
books = books.filter(media__type='mp3')
else:
books = books.exclude(media__type='mp3')
books = books.filter(media__type='mp3')
else:
books = books.exclude(media__type='mp3')
+ for key in request.GET:
+ if key in category_singular:
+ category = category_singular[key]
+ if category in book_tag_categories:
+ slugs = request.GET[key].split(',')
+ tags = Tag.objects.filter(category=category, slug__in=slugs)
+ books = Book.tagged.with_any(tags, books)
return super(FilterBooksHandler, self).read(request, books=books, after=after, before=before, count=count)
return super(FilterBooksHandler, self).read(request, books=books, after=after, before=before, count=count)