[Zope] dtml-let and Python Script

Dieter Maurer dieter@handshake.de
Wed, 27 Feb 2002 00:16:30 +0100


Peter Bengtsson writes:
 > Using DTML (This works for me but not what I want):
 > 
 > --- DTML Method index_html ---
 > <dtml-let age="50">
 >   <dtml-var message>
 > </dtml-let>
 > ------------------------------
 > 
 > --- DTML Method message ------
 > You are <dtml-var age> years old
 > ------------------------------
 > 
 > Using Python Script (this is what I want but doesn't
 > work for me):
 > 
 > [same index_html method as above]
 > 
 > --- Python Script message ------
 > return "You are %s years old"%context.age
 > ------------------------------
Look at the "Bindings" tab of your Python Script and
bind the (DTML) namespace (say to "_").

Then, you reference it with "_['age']" in the Python Script.


Dieter