1đź‘Ť
You’ve already solved the issue, but to answer your question about why that option exists, the documentation says:
A yearly archive page showing all available months in a given year.
… the template’s context will be:
- date_list: A DateQuerySet object containing all months that have objects available according to queryset, represented as datetime.datetime objects, in ascending order.
Class-based views are hard, and it’s worth reading the documentation very carefully, diving into the source (mostly django.views.generic
) and getting familiar with debugging techniques to step through the slightly tangled pile of inheritance going on with most views.
4đź‘Ť
It was a newbie mistake. I was not specifying make_object_list
in the class. You can see how it’s fixed at this commit.
From the documentation:
make_object_list
A boolean specifying whether to retrieve the full list of objects for this year and pass those to the template. If True, the list of objects will be made available to the context. By default, this is False.
So I’m not sure why that option exists, but it does. It doesn’t make much sense to me to return nothing by default (maybe a pagination thing?)
- [Django]-Heroku server error (500) when Debug = False , whitenoise could not find style.css
- [Django]-Django second to last iteration of for loop
- [Django]-Renderer returned unicode, and did not specify a charset value
- [Django]-Django Gunicorn – gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
0đź‘Ť
Yeah. I agree with you. I currently have my own implementation of this class-based generic view working, but I’m curious whether or not it’s “politically correct.” Anyway, it’s very board on how you can use this generic view, and I figured that this (make_object_list) attribute is an available option for coders to tinker with.
- [Django]-Django : CSRF verification failed even after adding {% csrf_token %}
- [Django]-Registration form with profile's field
- [Django]-AWS Elastic Beanstalk Django – What happens first when deploying to EB, pip install -r requirements.txt or commands in configuration file
- [Django]-Front-end prototype/skeleton in Django