Ticket #6372: fix_allow_empty.diff

File fix_allow_empty.diff, 1.3 KB (added by David Paccoud, 17 years ago)

Fix allow_empty in archive_week generic view

  • django/views/generic/date_based.py

    diff -r ac0efb4abee4 django/views/generic/date_based.py
    a b def archive_month(request, year, month,  
    164164
    165165def archive_week(request, year, week, queryset, date_field,
    166166        template_name=None, template_loader=loader,
    167         extra_context=None, allow_empty=True, context_processors=None,
     167        extra_context=None, allow_empty=False, context_processors=None,
    168168        template_object_name='object', mimetype=None, allow_future=False):
    169169    """
    170170    Generic weekly archive view.
  • docs/generic_views.txt

    diff -r ac0efb4abee4 docs/generic_views.txt
    a b in the *future* are not displayed unless  
    447447    * ``allow_empty``: A boolean specifying whether to display the page if no
    448448      objects are available. If this is ``False`` and no objects are available,
    449449      the view will raise a 404 instead of displaying an empty page. By
    450       default, this is ``True``.
     450      default, this is ``False``.
    451451
    452452    * ``context_processors``: A list of template-context processors to apply to
    453453      the view's template. See the `RequestContext docs`_.
Back to Top