fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
09f311c
)
book/picture-only tags in api
author
Jan Szejko
<janek37@gmail.com>
Thu, 21 Dec 2017 11:05:59 +0000
(12:05 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Thu, 21 Dec 2017 11:05:59 +0000
(12:05 +0100)
src/api/handlers.py
patch
|
blob
|
history
diff --git
a/src/api/handlers.py
b/src/api/handlers.py
index
159e4f2
..
a1e9f6a
100644
(file)
--- a/
src/api/handlers.py
+++ b/
src/api/handlers.py
@@
-523,6
+523,13
@@
class TagsHandler(BaseHandler, TagDetails):
tags = Tag.objects.filter(category=category_sng).exclude(items=None).order_by('slug')
tags = Tag.objects.filter(category=category_sng).exclude(items=None).order_by('slug')
+ book_only = request.GET.get('book_only') == 'true'
+ picture_only = request.GET.get('picture_only') == 'true'
+ if book_only:
+ tags = tags.filter(for_books=True)
+ if picture_only:
+ tags = tags.filter(for_pictures=True)
+
if after:
tags = tags.filter(slug__gt=after)
if before:
if after:
tags = tags.filter(slug__gt=after)
if before: