From: Jan Szejko Date: Tue, 28 Nov 2017 09:49:39 +0000 (+0100) Subject: correct children order in API X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/c185de4d8edb100d196b516aedd29b8ee0519ce0?ds=inline;hp=51369735b0c2f71ee63c1403da3254d5efed2b93 correct children order in API --- diff --git a/src/api/handlers.py b/src/api/handlers.py index 6f7179bd5..04c56f8f1 100644 --- a/src/api/handlers.py +++ b/src/api/handlers.py @@ -122,14 +122,12 @@ class BookDetails(object): @classmethod def url(cls, book): """ Returns Book's URL on the site. """ - return WL_BASE + book.get_absolute_url() @classmethod def children(cls, book): """ Returns all children for a book. """ - - return book.children.all() + return book.children.order_by('parent_number', 'sort_key') @classmethod def media(cls, book):