Generic view 'archive_year' produces blank HTML page

3 views
Skip to first unread message

Matthew

unread,
Aug 10, 2009, 7:27:20 PM8/10/09
to Django users
I am using Django's generic views to create a blog site. The
templates I created, entry_archive_day, entry_archive_month,
entry_archive, and entry_detail all work perfectly, but
entry_archive_year does not.

Instead, it is simply a blank page. It looks like it sees no objects
in 'object_list'.

I know that 'archive' uses a 'latest' list instead of 'object_list',
but that's not the case with 'archive_year', correct?

Thanks,
Matthew

Alasdair

unread,
Aug 10, 2009, 8:35:10 PM8/10/09
to Django users
archive_year doesn't add a list of objects to the context by default.
Instead, it adds date_list, a list of months that have objects
available in the given year.

To add object_list to the context, use the optional argument
make_object_list=True when calling archive_year.

For more info, look at the docs at
http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-date-based-archive-year

Alasdair

Matthew

unread,
Sep 12, 2009, 7:51:00 AM9/12/09
to Django users
Here is more information:

http://stackoverflow.com/questions/1257943/generic-view-archiveyear-produces-blank-page

On Aug 10, 8:35 pm, Alasdair <alasdairapni...@googlemail.com> wrote:
> archive_year doesn't add a list of objects to the context by default.
> Instead, it adds date_list, a list of months that have objects
> available in the given year.
>
> To add object_list to the context, use the optional argument
> make_object_list=True when calling archive_year.
>
> For more info, look at the docs athttp://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-...
Reply all
Reply to author
Forward
0 new messages