From b45fd3ffdf2f238e0d16e56895e09c99f2ec50b1 Mon Sep 17 00:00:00 2001 From: Karen Tracey Date: Sun, 10 Jan 2010 19:52:17 +0000 Subject: Fixed: 3274: Added date_list context variable to the archive_month generic view, consistent with archive_index and archive_year. Thanks Sean Brant. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12195 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/views/generic/date_based.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'django') diff --git a/django/views/generic/date_based.py b/django/views/generic/date_based.py index 0d9ecaca32..726df59654 100644 --- a/django/views/generic/date_based.py +++ b/django/views/generic/date_based.py @@ -105,6 +105,8 @@ def archive_month(request, year, month, queryset, date_field, Templates: ``/_archive_month.html`` Context: + date_list: + List of days in this month with objects month: (date) this month next_month: @@ -139,6 +141,7 @@ def archive_month(request, year, month, queryset, date_field, if last_day >= now.date() and not allow_future: lookup_kwargs['%s__lte' % date_field] = now object_list = queryset.filter(**lookup_kwargs) + date_list = object_list.dates(date_field, 'day') if not object_list and not allow_empty: raise Http404 @@ -160,6 +163,7 @@ def archive_month(request, year, month, queryset, date_field, template_name = "%s/%s_archive_month.html" % (model._meta.app_label, model._meta.object_name.lower()) t = template_loader.get_template(template_name) c = RequestContext(request, { + 'date_list': date_list, '%s_list' % template_object_name: object_list, 'month': date, 'next_month': next_month, -- cgit v1.3