So i was digging in Django's source codes and came across these two:
views.generic.list.py
and views.generic.base.py
so this is line 26 in base.py
in ContextMixin
's get_context_data
method
if self.extra_context is not None:
kwargs.update(self.extra_context)
return kwargs
MultipleObjectMixin
(line 9 in list.py
) inherits ContextMixin
and calls the parent class's method in the overwritten get_context_data
method (line 136 in list.py
)
So the extra_context
variable should work and add extra context to the dictionary passed to template engine in classes that use the MultipleObjectMixin
.
But the questions i looked up stated that extra_context
isn't supported anymore, and i ran a code that didn't work and i had to overwrite get_context_data
to get what i wanted, does anyone have any explanations about this?
P.S. I checked the installed sources on my system, and it was different than the github code, so my question now is why is the repository behind from latest released versions?