fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
You forgot XML.
[wolnelektury.git]
/
src
/
api
/
handlers.py
diff --git
a/src/api/handlers.py
b/src/api/handlers.py
index
eb18e05
..
cd24561
100644
(file)
--- a/
src/api/handlers.py
+++ b/
src/api/handlers.py
@@
-63,6
+63,7
@@
def read_tags(tags, request, allowed):
def process(category, slug):
if category == 'book':
def process(category, slug):
if category == 'book':
+ # FIXME: Unused?
try:
books.append(Book.objects.get(slug=slug))
except Book.DoesNotExist:
try:
books.append(Book.objects.get(slug=slug))
except Book.DoesNotExist:
@@
-221,6
+222,7
@@
class AnonymousBooksHandler(AnonymousBaseHandler, BookDetails):
model = Book
fields = book_list_fields
model = Book
fields = book_list_fields
+ # FIXME: Unused?
@classmethod
def genres(cls, book):
""" Returns all media for a book. """
@classmethod
def genres(cls, book):
""" Returns all media for a book. """
@@
-239,6
+241,7
@@
class AnonymousBooksHandler(AnonymousBaseHandler, BookDetails):
are returned.
"""
if pk is not None:
are returned.
"""
if pk is not None:
+ # FIXME: Unused?
try:
return Book.objects.get(pk=pk)
except Book.DoesNotExist:
try:
return Book.objects.get(pk=pk)
except Book.DoesNotExist:
@@
-606,6
+609,7
@@
class TagsHandler(BaseHandler, TagDetails):
def read(self, request, category=None, pk=None):
""" Lists all tags in the category (eg. all themes). """
if pk is not None:
def read(self, request, category=None, pk=None):
""" Lists all tags in the category (eg. all themes). """
if pk is not None:
+ # FIXME: Unused?
try:
return Tag.objects.exclude(category='set').get(pk=pk)
except Book.DoesNotExist:
try:
return Tag.objects.exclude(category='set').get(pk=pk)
except Book.DoesNotExist:
@@
-759,6
+763,7
@@
class UserDataHandler(BaseHandler):
class UserShelfHandler(BookDetailHandler):
fields = book_list_fields + ['liked']
class UserShelfHandler(BookDetailHandler):
fields = book_list_fields + ['liked']
+ # FIXME: Unused?
def parse_bool(self, s):
if s in ('true', 'false'):
return s == 'true'
def parse_bool(self, s):
if s in ('true', 'false'):
return s == 'true'