Can jinja templates contain arbitrary python code? In mako, I could do (for example): -------- from mako.template import Template
mytemplate = Template('''
<%!
from math import sin, pi
%>
hello ${name}!
${x}**2 = ${x**2}
% for i in xrange (10):
w[${i}] = ${sin (pi/4*i)}
% endfor
''')
d = {'name' : 'Neal',
'x' : 10
}
print mytemplate.render(**d)
--------
Could I do something similar in jinja? (import code, call arbitrary
functions...)
--
http://mail.python.org/mailman/listinfo/python-list
