Python vs PHP

Istvan Albert ialbert at mailblocks.com
Sat Oct 23 19:46:30 CEST 2004


Alex Martelli wrote:

> Not sure what example you mean:

http://www.divmod.org/Home/Projects/Nevow/

data/render methods

> But the point is, the logic
> is in the code, Python code well out of this HTML file; the role of the
> template is to provide the HTML basis, and tag where the current data
> comes from, which method renders it

The render_colorful method creates a new attribute "color" that
was not specified in the template. They may have moved all python
out from HTML but surely did not move out all HTML from the
python code.

I would argue that this is not templating in the way
people use this term. Here the "color" attribute just
appears from thin air.

I stick to my opinion that every framework must allow one to bend
the rules because in real situations one cannot always choose
*the right thing*.  What nevow seems to be doing is bend
them by allowing  HTML to be moved into python,
or to say it more nicely, by allowing python to modify
the template document object model (DOM).

Istvan.



More information about the Python-list mailing list