templating system

Steve Holden steve at holdenweb.com
Sun Apr 10 21:00:32 EDT 2005


Ksenia Marasanova wrote:
> 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_class()
>     return template('some_template.tmpl', **locals()).render()
> 
> # in some_template.tmpl:
> 
> <ul>
> <%for record in records%>
>     <li><a href="<%=record.id%>"><%=record.title%></a></li>
> <%end for%>
> </ul>
> 
> 
>>From what I saw Cheetah seems to be the only one that can do it. I was
> hoping there might be alternatives that I've missed :)
> Thanks!
> 
http://www.reportlab.org/preppy.html

regards
  Steve
-- 
Steve Holden        +1 703 861 4237  +1 800 494 3119
Holden Web LLC             http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/




More information about the Python-list mailing list