O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

17.7.1 Yearly Archive for Post

The YearArchiveView GCBV is a view that allows for the organization of objects published in a specific year. The model class used with YearArchiveView must therefore have a DateField or a DateTimeField.

I did not say that the GCBV displays the object list, because that behavior is actually optional. The YearArchiveView GCBV exhibits two behaviors. By default, it assumes that developers will wish to list the months that objects were published in a year. If in 2015, we published blog posts in January and March, then YearArchiveView will create a template context variable called date_list that contains the dates for January 2015 and March 2015, allowing us to link to MonthArchviveView subclasses. The second behavior ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required