summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/generic_views.txt18
1 files changed, 13 insertions, 5 deletions
diff --git a/docs/generic_views.txt b/docs/generic_views.txt
index 96635f7d3f..33c39b7e12 100644
--- a/docs/generic_views.txt
+++ b/docs/generic_views.txt
@@ -688,9 +688,8 @@ A page representing a list of objects.
* ``paginate_by``: An integer specifying how many objects should be
displayed per page. If this is given, the view will paginate objects with
``paginate_by`` objects per page. The view will expect either a ``page``
- query string parameter (via ``GET``) containing a 1-based page
- number, or a ``page`` variable specified in the URLconf. See
- "Notes on pagination" below.
+ query string parameter (via ``GET``) or a ``page`` variable specified in
+ the URLconf. See "Notes on pagination" below.
* ``template_name``: The full name of a template to use in rendering the
page. This lets you override the default template name (see below).
@@ -780,7 +779,7 @@ specify the page number in the URL in one of two ways:
(r'^objects/page(?P<page>[0-9]+)/$', 'object_list', dict(info_dict))
* Pass the page number via the ``page`` query-string parameter. For
- example, a URL would look like this:
+ example, a URL would look like this::
/objects/?page=3
@@ -789,7 +788,16 @@ specify the page number in the URL in one of two ways:
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``.
+represented as page ``1``. As a special case, you are also permitted to use
+``last`` as a value for ``page``::
+
+ /objects/?page=last
+
+This allows you to access the final page of results without first having to
+determine how many pages there are.
+
+Note that ``page`` *must* be either a valid page number or the value ``last``;
+any other value for ``page`` will result in a 404 error.
``django.views.generic.list_detail.object_detail``
--------------------------------------------------