Hi,
I am looking for fast, simple templating system that will allow me to
do the following:
- embed Python code (or some templating code) in the template
- generate text output (not only XML/HTML)
I don't need a framework (already have it), but just simple
templating. The syntax I had in mind is something like that:
# in Python module
def some_view():
# some code goes here...
records = get_some_data()
req = get_request_cla ss()
return template('some_ template.tmpl', **locals()).ren der()
# in some_template.t mpl:
<ul>
<%for record in records%>
<li><a href="<%=record .id%>"><%=recor d.title%></a></li>
<%end for%>
</ul>
[color=blue]
>From what I saw Cheetah seems to be the only one that can do it. I was[/color]
hoping there might be alternatives that I've missed :)
Thanks!
--
Ksenia
I am looking for fast, simple templating system that will allow me to
do the following:
- embed Python code (or some templating code) in the template
- generate text output (not only XML/HTML)
I don't need a framework (already have it), but just simple
templating. The syntax I had in mind is something like that:
# in Python module
def some_view():
# some code goes here...
records = get_some_data()
req = get_request_cla ss()
return template('some_ template.tmpl', **locals()).ren der()
# in some_template.t mpl:
<ul>
<%for record in records%>
<li><a href="<%=record .id%>"><%=recor d.title%></a></li>
<%end for%>
</ul>
[color=blue]
>From what I saw Cheetah seems to be the only one that can do it. I was[/color]
hoping there might be alternatives that I've missed :)
Thanks!
--
Ksenia
Comment