[mod_python] supporting modular mod_python extensionsvs."folding" mod_psp

Geert Jansen geert at boskant.nl
Sat Jun 7 11:02:10 EST 2003


> You are of course correct.  The <% python code %> construct 
> just makes it a lot easier to place application code in the 
> wrong place.  That is not really a criticism of the 
> mechanism, it is a criticism of people who do that.

Yes, I agree fully.

> Mind you, I could argue that while you have not introduced a 
> third language, you have introduced a new mechanism.  That 
> was part of the point I was trying to make.  You need either 
> a new language or a special mechanism.

Ok, fair enough.
 
> > reduces your formatting code to something like this:
> >  
> > <%
> >     for tr in rows:
> >         print """
> >             html formatted string
> >              """ % tr
> > %>
> 
> How is the application namespace made available to the templating?

Funny that you should say namespace, because that is the 3rd and last
central concept in Draco ;-) (the others are templates and handlers).
The variables from the "interface" namespace are available as global
variables to all code in templates.

Other namespaces include "session", "user", "cookie", "config" and
"args". All of these have a different meaning and putting variables in
them does different things. Namespaces are _the_ mechanism in Draco to
use for persistency.

> No argument here.
> 
> I have toyed with the idea of experimenting with different 
> templating mechanisms in Albatross.  The templating is only 
> part of the problem that Albatross is trying to address.

Yes, the same goes for Draco here. I've had some requests to support TAL
(OpenTAL) as the templating language, as this is becoming a sort of
de-facto standard. If I get to it one day I will.

Cheers,
Geert



More information about the Mod_python mailing list