- '''
- Paginator for cases when the list of items is already finite.
-
- A good example is a list generated from an API call. This is a subclass
- of InfinitePaginator because we have no idea how many items exist in the
- full collection.
-
- To accurately determine if the next page exists, a FinitePaginator MUST be created
- with an object_list_plus that may contain more items than the per_page count.
- Typically, you'll have an object_list_plus with one extra item (if there's a next page).
- You'll also need to supply the offset from the full collection in order to get the
- page start_index.
-
- This is a very silly class but useful if you love the Django pagination conventions.
- '''
-
- def __init__(self, object_list_plus, per_page, offset=None, allow_empty_first_page=True, link_template='/page/%d/'):
- super(FinitePaginator, self).__init__(object_list_plus, per_page, allow_empty_first_page, link_template)
+ """
+ Paginator for cases when the list of items is already finite.
+
+ A good example is a list generated from an API call. This is a subclass
+ of InfinitePaginator because we have no idea how many items exist in the
+ full collection.
+
+ To accurately determine if the next page exists, a FinitePaginator MUST be
+ created with an object_list_plus that may contain more items than the
+ per_page count. Typically, you'll have an object_list_plus with one extra
+ item (if there's a next page). You'll also need to supply the offset from
+ the full collection in order to get the page start_index.
+
+ This is a very silly class but useful if you love the Django pagination
+ conventions.
+ """
+
+ def __init__(self, object_list_plus, per_page, offset=None,
+ allow_empty_first_page=True, link_template='/page/%d/'):
+ super(FinitePaginator, self).__init__(object_list_plus, per_page,
+ allow_empty_first_page, link_template)