I have trouble transforming the following code into the new django 1.3 class-based generic view format. Specifically, I don’t understand how I can pass the ‘extra_context’ to the class based view. Can someone help me transform this code to the new notation? or post a link to a good example? I’ve read the docs but the example is very flimsy.
def return_event_list_object(request, username, queryset, entries_per_page, param1, param2):
...
...
return object_list(request, queryset = queryset,
template_name = 'myapp/list_events.html',
paginate_by = int(entries_per_page),
template_object_name = 'event',
extra_context = {'param1': param1,
'param2': param2, } )
I appreciate your input!
The
extra_contextsection of the docs explains how to add items to the context:In your case, try: