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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access