summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2010-01-10 19:52:17 +0000
committerKaren Tracey <kmtracey@gmail.com>2010-01-10 19:52:17 +0000
commitb45fd3ffdf2f238e0d16e56895e09c99f2ec50b1 (patch)
tree02bb0db124330d5f5a6ccad706805ee6fcf5ffc0 /django
parent9bb1fa725154e6d1d0317fa0c48d7c240ad5e2d4 (diff)
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
Diffstat (limited to 'django')
-rw-r--r--django/views/generic/date_based.py4
1 files changed, 4 insertions, 0 deletions
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: ``<app_label>/<model_name>_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,