From 6c06f8f10f76595bd91fa802a5b9d3039a330af7 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 18 Mar 2008 21:58:31 +0000 Subject: [PATCH] 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 --- docs/generic_views.txt | 17 +++++++++++++++-- 1 file 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 ~~~~~~~~~~~~~~~~~~~