summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-09-14 01:01:02 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-09-14 01:01:02 +0000
commit87e77ffca0a7df59ff9407ef30a2baa90f1d872d (patch)
tree94a098a50cb4a2b1cb68da3e94f6564e2b9caf4e /docs
parentcb9db449380d80f1e5856e64fd7cde15da63a315 (diff)
Fixed #1795 -- Added page_range to paginators in generic list views. Thanks to polarcowz@gmail.com and Marc Fargas <telenieko@telenieko.com> for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6146 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/generic_views.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/generic_views.txt b/docs/generic_views.txt
index 0601aead11..96635f7d3f 100644
--- a/docs/generic_views.txt
+++ b/docs/generic_views.txt
@@ -765,6 +765,9 @@ If the results are paginated, the context will contain these extra variables:
* ``hits``: The total number of objects across *all* pages, not just this
page.
+ * ``page_range``: A list of the page numbers that are available. This
+ is 1-based.
+
Notes on pagination
~~~~~~~~~~~~~~~~~~~
@@ -781,7 +784,11 @@ specify the page number in the URL in one of two ways:
/objects/?page=3
-In both cases, ``page`` is 1-based, not 0-based, so the first page would be
+ * To loop over all the available page numbers, use the ``page_range``
+ variable. You can iterate over the list provided by ``page_range``
+ to create a link to every page of results.
+
+These values and lists are is 1-based, not 0-based, so the first page would be
represented as page ``1``.
``django.views.generic.list_detail.object_detail``