Permalink
Browse files

Added htmlbools filter to jinja templates

  • Loading branch information...
clsdaniel committed Aug 4, 2012
1 parent da25dbf commit fb00eac669c5fca1fe177e054e503faabbd14a0a
Showing with 6 additions and 1 deletion.
  1. +6 −1 tw2/core/templating.py
@@ -161,7 +161,12 @@ def get_render_callable(engine_name, displays_on, src, filename=None):
elif engine_name == 'jinja':
import jinja2
tmpl = jinja2.Template(src)
from jinja_util import htmlbools
env = jinja2.environment.get_spontaneous_environment()
env.filters['htmlbools'] = htmlbools
tmpl = env.from_string(src, template_class=jinja2.Template)
#tmpl = jinja2.Template(src)
#tmpl.environment.filters['htmlbools'] = htmlbools
tmpl.filename = filename
return lambda kwargs: Markup(tmpl.render(**kwargs))

0 comments on commit fb00eac

Please sign in to comment.