November 2015
Beginner to intermediate
840 pages
26h 30m
English
PostSurprisingly, Django’s MonthArchiveView GCBV does not work like YearArchiveView GCBV. The MonthArchiveView GCBV does not recognize make_object_list, assuming instead that developers will want to display objects in this template. However, MonthArchiveView also provides the date_list to the template context, created on the basis of the same date_list_period attribute found in YearArchiveView (the default of which is 'day' in MonthArchiveView).
We won’t be creating a day archive view for our Post model, as we shouldn’t have more than a few blog posts a month. We therefore won’t use the date_list context variable. Our view will list only objects published that month.
Read now
Unlock full access