Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Documented migration path for change object_list -> ListView regardin…

…g different context variables

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14650 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d4c6abcbd10da9816a834883f3bfb05fb67222bc 1 parent ece3a7c
@spookylukey spookylukey authored
View
2  django/views/generic/list_detail.py
@@ -71,10 +71,10 @@ def object_list(request, queryset, paginate_by=None, page=None,
'%s_list' % template_object_name: page_obj.object_list,
'paginator': paginator,
'page_obj': page_obj,
+ 'is_paginated': page_obj.has_other_pages(),
# Legacy template context stuff. New templates should use page_obj
# to access this instead.
- 'is_paginated': page_obj.has_other_pages(),
'results_per_page': paginator.per_page,
'has_next': page_obj.has_next(),
'has_previous': page_obj.has_previous(),
View
20 docs/topics/generic-views-migration.txt
@@ -74,6 +74,26 @@ was appended with the suffix ``'_list'`` to yield the final context
variable name. In a class-based ``ListView``, the
``context_object_name`` is used verbatim.
+The context data for ``object_list`` views
+------------------------------------------
+
+The context provided by :class:`~django.views.generic.list.MultipleObjectMixin`
+is quite different from that provided by ``object_list``, with most pagination
+related variables replaced by a single ``page_obj`` object. The following are no
+longer provided:
+
+* ``first_on_page``
+* ``has_next``
+* ``has_previous``
+* ``hits``
+* ``last_on_page``
+* ``next``
+* ``page_range``
+* ``page``
+* ``pages``
+* ``previous``
+* ``results_per_page``
+
``extra_context``
-----------------
Please sign in to comment.
Something went wrong with that request. Please try again.