From 87b22d351ce199326613811ad544e24e0fa53d28 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Thu, 21 Dec 2017 12:05:59 +0100 Subject: [PATCH] book/picture-only tags in api --- src/api/handlers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/api/handlers.py b/src/api/handlers.py index 159e4f235..a1e9f6a23 100644 --- 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') + 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: -- 2.20.1