Added a pagination example to ListView docs.

This commit is contained in:
AK 2018-03-24 12:45:09 -04:00 committed by Tim Graham
parent 4554f9a783
commit 3990d74018
2 changed files with 9 additions and 1 deletions

View file

@ -74,6 +74,7 @@ page::
objects such as Django's ``QuerySet`` to use a more efficient ``count()``
method when available.
.. _using-paginator-in-view:
Using ``Paginator`` in a view
==============================
@ -97,7 +98,9 @@ The view function looks like this::
return render(request, 'list.html', {'contacts': contacts})
In the template :file:`list.html`, you'll want to include navigation between
pages along with any interesting information from the objects themselves::
pages along with any interesting information from the objects themselves:
.. code-block:: html+django
{% for contact in contacts %}
{# Each "contact" is a Contact model object. #}