diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2007-09-14 01:52:10 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-09-14 01:52:10 +0000 |
| commit | d14c756b5e30c73fcb973905b67f091169d33595 (patch) | |
| tree | 898cf22b3325484257631ab542e7177c6d77cdbd /docs | |
| parent | 62fe5cf138b406a2e478bd5a26b1227d1190e186 (diff) | |
Fixed #4919 -- Added 'last' marker on paginators. Thanks to patrick@vonautomatisch.atfor the idea, and nick@efford.org for the patch and docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6149 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/generic_views.txt | 18 |
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`` -------------------------------------------------- |
