mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Added a pagination example to ListView docs.
This commit is contained in:
parent
4554f9a783
commit
3990d74018
2 changed files with 9 additions and 1 deletions
|
@ -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. #}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue