Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Luke Plant authored November 20, 2010
2  django/views/generic/list_detail.py
@@ -71,10 +71,10 @@ def object_list(request, queryset, paginate_by=None, page=None,
71 71
             '%s_list' % template_object_name: page_obj.object_list,
72 72
             'paginator': paginator,
73 73
             'page_obj': page_obj,
  74
+            'is_paginated': page_obj.has_other_pages(),
74 75
 
75 76
             # Legacy template context stuff. New templates should use page_obj
76 77
             # to access this instead.
77  
-            'is_paginated': page_obj.has_other_pages(),
78 78
             'results_per_page': paginator.per_page,
79 79
             'has_next': page_obj.has_next(),
80 80
             'has_previous': page_obj.has_previous(),
20  docs/topics/generic-views-migration.txt
@@ -74,6 +74,26 @@ was appended with the suffix ``'_list'`` to yield the final context
74 74
 variable name. In a class-based ``ListView``, the
75 75
 ``context_object_name`` is used verbatim.
76 76
 
  77
+The context data for ``object_list`` views
  78
+------------------------------------------
  79
+
  80
+The context provided by :class:`~django.views.generic.list.MultipleObjectMixin`
  81
+is quite different from that provided by ``object_list``, with most pagination
  82
+related variables replaced by a single ``page_obj`` object. The following are no
  83
+longer provided:
  84
+
  85
+* ``first_on_page``
  86
+* ``has_next``
  87
+* ``has_previous``
  88
+* ``hits``
  89
+* ``last_on_page``
  90
+* ``next``
  91
+* ``page_range``
  92
+* ``page``
  93
+* ``pages``
  94
+* ``previous``
  95
+* ``results_per_page``
  96
+
77 97
 ``extra_context``
78 98
 -----------------
79 99
 

0 notes on commit d4c6abc

Please sign in to comment.
Something went wrong with that request. Please try again.