Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #685 -- archive_index() and object_list() generic views allow e…

…mpty

result sets by default now. Thanks, Gary Wilson and Matt Croydon.

This is a backwards incompatible change.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6833 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9075ac4b76f9e52e09fd2946f8f485b3ce6acf42 1 parent 81832f5
Malcolm Tredinnick authored December 02, 2007
2  django/views/generic/date_based.py
@@ -9,7 +9,7 @@
9 9
 
10 10
 def archive_index(request, queryset, date_field, num_latest=15,
11 11
         template_name=None, template_loader=loader,
12  
-        extra_context=None, allow_empty=False, context_processors=None,
  12
+        extra_context=None, allow_empty=True, context_processors=None,
13 13
         mimetype=None, allow_future=False, template_object_name='latest'):
14 14
     """
15 15
     Generic top-level archive of date-based objects.
2  django/views/generic/list_detail.py
@@ -5,7 +5,7 @@
5 5
 from django.core.exceptions import ObjectDoesNotExist
6 6
 
7 7
 def object_list(request, queryset, paginate_by=None, page=None,
8  
-        allow_empty=False, template_name=None, template_loader=loader,
  8
+        allow_empty=True, template_name=None, template_loader=loader,
9 9
         extra_context=None, context_processors=None, template_object_name='object',
10 10
         mimetype=None):
11 11
     """
4  docs/generic_views.txt
@@ -188,7 +188,7 @@ a date in the *future* are not included unless you set ``allow_future`` to
188 188
     * ``allow_empty``: A boolean specifying whether to display the page if no
189 189
       objects are available. If this is ``False`` and no objects are available,
190 190
       the view will raise a 404 instead of displaying an empty page. By
191  
-      default, this is ``False``.
  191
+      default, this is ``True``.
192 192
 
193 193
     * ``context_processors``: A list of template-context processors to apply to
194 194
       the view's template. See the `RequestContext docs`_.
@@ -718,7 +718,7 @@ A page representing a list of objects.
718 718
     * ``allow_empty``: A boolean specifying whether to display the page if no
719 719
       objects are available. If this is ``False`` and no objects are available,
720 720
       the view will raise a 404 instead of displaying an empty page. By
721  
-      default, this is ``False``.
  721
+      default, this is ``True``.
722 722
 
723 723
     * ``context_processors``: A list of template-context processors to apply to
724 724
       the view's template. See the `RequestContext docs`_.

0 notes on commit 9075ac4

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