diff options
| author | AK <andrei.avk@gmail.com> | 2018-03-24 12:45:09 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-03-26 11:40:54 -0400 |
| commit | 3990d740180bc49a1479b8a2918b0878df65518a (patch) | |
| tree | afe643b4ad21af965500363d30311934427467b5 /docs/topics | |
| parent | 4554f9a783665d64b59c35b53ae71178e56ac783 (diff) | |
Added a pagination example to ListView docs.
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/pagination.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/topics/pagination.txt b/docs/topics/pagination.txt index 80a6b66fc6..b095015b57 100644 --- a/docs/topics/pagination.txt +++ b/docs/topics/pagination.txt @@ -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. #} |
