correct children order in API
authorJan Szejko <janek37@gmail.com>
Tue, 28 Nov 2017 09:49:39 +0000 (10:49 +0100)
committerJan Szejko <janek37@gmail.com>
Tue, 28 Nov 2017 09:49:39 +0000 (10:49 +0100)
src/api/handlers.py

index 6f7179b..04c56f8 100644 (file)
@@ -122,14 +122,12 @@ class BookDetails(object):
     @classmethod
     def url(cls, book):
         """ Returns Book's URL on the site. """
     @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 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):
 
     @classmethod
     def media(cls, book):