HTML generation vs PSP vs Templating Engines

has has.temp2 at virgin.net
Sat Nov 19 19:38:45 EST 2005


riplin at Azonic.co.nz wrote:
> I dislike embedding code or html in each other, apart from the
> 'impurity' of mixing code and user interface it makes them inseparable.
>
> Using templates means that the code can work with different templates,
> and this should be seamless, it also means that different code can be
> used with the templates, for example if different languages are used.

This seems to contradict your statement that you dislike 'embedding
code or html in each other', since the scenarios you describe still
involve embedding presentation logic in markup. (The only templating
systems that *completely* separate logic from markup are the DOM-style
ones.)

I assume what you really meant is that you don't like embedding *model*
logic in markup, which is generally good design practice. However,
templating systems that use Python for presentation logic (Karrigell,
PSP, Nevow, HTMLTemplate, etc) certainly don't force you to put model
logic into the template; you are quite entitled to keep that separate
as per MVC. They just don't *enforce* the model logic/presentation
logic separation as some authoritarian custom language-based systems
do.

HTH




More information about the Python-list mailing list