Paging ====== Two view mixins live in ``richy.core.views``: one for paginating a ``ListView`` automatically, one for paginating any arbitrary queryset / iterable. Both render through the shared ``_paging.pug`` template (see :doc:`/frontend/templates/includables`). ModelPaginatorMixin ------------------- Drop-in mixin for a Django ``ListView`` that adds a ``pages`` and a ``paginator`` context variable -- the ``_paging.pug`` include then renders the pager UI. Default page size is 20; override ``paginate_by`` on the view to change it. .. autoclass:: richy.core.views.ModelPaginatorMixin :show-inheritance: .. automethod:: richy.core.views.ModelPaginatorMixin.get_context_data PaginatorMixin -------------- Lower-level mixin for paginating an arbitrary list / queryset (not necessarily the one driving a ``ListView``). Exposes ``get_paginator()``, which returns ``(page, elided_page_range)`` -- a tuple the view passes to the template. .. autoclass:: richy.core.views.PaginatorMixin :show-inheritance: .. automethod:: richy.core.views.PaginatorMixin.get_paginator