Skip to content
Browse files

Include total number of pages and objects in serialisation of Page

  • Loading branch information...
1 parent 1477c50 commit df1d97d654a6786e07bde3d7eeeb8a7b94100e9a @cnorthwood cnorthwood committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 molly/utils/simplify.py
View
4 molly/utils/simplify.py
@@ -63,7 +63,9 @@ def simplify_value(value):
'next_page_number': value.has_next(),
'previous_page_number': value.has_next(),
'number': value.number,
- 'objects': simplify_value(value.object_list)
+ 'objects': simplify_value(value.object_list),
+ 'num_pages': value.paginator.num_pages,
+ 'num_objects': value.paginator.count,
}
elif value is None:
return None

0 comments on commit df1d97d

Please sign in to comment.
Something went wrong with that request. Please try again.