Carlos,
While you are making changes to app_config.py could you add a new
configuration option to be able define autoescape at the main level :
if not 'jinja_filters' in self:
self.jinja_filters = {}
if not 'jinja_autoescape' in self:
self.jinja_autoescape = False
loader = ChoiceLoader(
[TemplateLoader(path) for path in self.paths['templates']])
config['pylons.app_globals'].jinja2_env = Environment(
autoescape=self.jinja_autoescape, loader=loader,
auto_reload=self.auto_reload_templates,
extensions=self.jinja_extensions)
so we can define
base_config.jinja_extensions = ['jinja2.ext.with_', 'jinja2.ext.autoescape']
base_config.jinja_autoescape = True
in app_cfg.py
or perhaps there is a better option to achieve this.
Le 29/09/2012 21:58, Carlos Daniel Ruvalcaba Valenzuela a écrit :
I pushed to my development branch something very similar, but would
like some input from core developers before getting to the pull
request.
https://github.com/clsdaniel/tg2/commit/7cc62f9130fc9651e7258490874bbc3ca886ba90
I'm not sure about having a dictionary inside the __init__.py called
jinja_filters, if you have the file and define the dict on __init__.py
you will not be able to import jinja_filters.py the way we are doing
it right now (via __import__), but we can add a special case to manage
that. Keeping it simple seems to be the way to go in my opinion.
Perhaps the jinja quickstart template could include
templatetools/__init__.py and jinja_filter.py files with some comments
to guide the developer.
Regards,
Carlos Daniel Ruvalcaba Valenzuela
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to turbogears@googlegroups.com.
To unsubscribe from this group, send email to
turbogears+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.