Django generic view - clarification on extra_context property - github vs installed source -
so digging in django's source codes , came across these two: views.generic.list.py
, views.generic.base.py
so line 26 in base.py
in contextmixin
's get_context_data
method
if self.extra_context not none: kwargs.update(self.extra_context) return kwargs
multipleobjectmixin
(line 9 in list.py
) inherits contextmixin
, calls parent class's method in overwritten get_context_data
method (line 136 in list.py
)
so extra_context
variable should work , add context dictionary passed template engine in classes use multipleobjectmixin
. questions looked stated extra_context
isn't supported anymore, , ran code didn't work , had overwrite get_context_data
wanted, have explanations this?
p.s. checked installed sources on system, , different github code, question why repository behind latest released versions?
i think saw question extra_context
djnago 1.5 or close that, assumed feature existed , removed , gave me impression master branch behind latest release seems, , @knbk pointed out, it's newly added (or maybe revived) feature.
so, guess explains everything. i'd happy accept more complete answer if has 1 :) or i'll go own answer close question.
Comments
Post a Comment