From: Thierry Parmentelat Date: Sun, 24 Mar 2013 10:26:23 +0000 (+0100) Subject: internal fileds of a plugin (the ones from __dict__) are automatically visible in... X-Git-Tag: myslice-django-0.1-2~16 X-Git-Url: http://git.onelab.eu/?p=unfold.git;a=commitdiff_plain;h=336354f96751fee9b20ec3b4ada0d027c9642ac7 internal fileds of a plugin (the ones from __dict__) are automatically visible in template (and can be redefined in template_env) --- diff --git a/unfold/plugin.py b/unfold/plugin.py index 178cbc66..278c362f 100644 --- a/unfold/plugin.py +++ b/unfold/plugin.py @@ -167,7 +167,12 @@ class Plugin: def render_content (self, request): """Should return an HTML fragment""" template = self.template_file() - env=self.template_env(request) + # start with a fresh one + env={} + # add our own settings as defaults + env.update(self.__dict__) + # then the things explicitly defined in template_env() + env.update(self.template_env(request)) if not isinstance (env,dict): raise Exception, "%s.template_env returns wrong type"%self.classname result=render_to_string (template, env)