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 ...
Get Django Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.