[Zope] tal:define limitations

Dieter Maurer dieter at handshake.de
Sun Oct 19 13:12:12 EDT 2003


Michael Bernstein wrote at 2003-10-17 15:48 -0700:
 > I just stumbled across the fact that variables that are defined via 
 > tal:define apparently must conform to Python identifier conventions 
 > (must start with a letter or underscore, etc.).

And this is good so...

 > ...
 > http://example.com/sample?1=off
 > 
 > I would like the following code to work:
 > 
 > <html tal:define="1 request/1 | string:on">

And later you will use "tal:define x python: x+1"
and be puzzled that you get a "TypeError"?

Use prefixes and convert special characters to make your URL parameters
into valid Python names.


Dieter



More information about the Zope mailing list