diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2008-03-18 21:58:31 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2008-03-18 21:58:31 +0000 |
| commit | 6c06f8f10f76595bd91fa802a5b9d3039a330af7 (patch) | |
| tree | 413050887791b7473b401cca19d0a76d803aa7e3 /docs | |
| parent | 6c2a78b26653739fe688dbf4d97b27aab1ebeca7 (diff) | |
Improved docs/generic_views.txt to note the new template context for the object_list generic view
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7309 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/generic_views.txt | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/docs/generic_views.txt b/docs/generic_views.txt index 17187894c0..b7beb0b4be 100644 --- a/docs/generic_views.txt +++ b/docs/generic_views.txt @@ -751,6 +751,19 @@ In addition to ``extra_context``, the template's context will be: If the results are paginated, the context will contain these extra variables: + * **New in Django development version:** ``paginator``: An instance of + ``django.core.paginator.Paginator``. + + * **New in Django development version:** ``page_obj``: An instance of + ``django.core.paginator.Page``. + +In older versions of Django, before ``paginator`` and ``page_obj`` were added +to this template's context, the template included several other variables +related to pagination. Note that you should *NOT* use these variables anymore; +use ``paginator`` and ``page_obj`` instead, because they let you do everything +these old variables let you do (and more!). But for legacy installations, +here's a list of those old template variables: + * ``results_per_page``: The number of objects per page. (Same as the ``paginate_by`` parameter.) @@ -777,8 +790,8 @@ 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. - * **New in Django development version:** ``page_range``: A list of the - page numbers that are available. This is 1-based. + * ``page_range``: A list of the page numbers that are available. This is + 1-based. Notes on pagination ~~~~~~~~~~~~~~~~~~~ |
