[Zope] Using the Namespace binding

Evan Simpson evan@4-am.com
Tue, 5 Jun 2001 17:37:32 -0400


From: "Lee Shakespeare" <lee@webfoundry.co.uk>
> I've tried _.varname, which gave me an attribute error and _varname is
> an illegal variable name.

You use the namespace in Scripts in exactly the same way as in DTML
expressions.  Since you would have to write:

<dtml-var expr="_['varname']"> or <dtml-var expr="_.getitem('varname', 0)">

...to get the rendered or unrendered version of 'varname', respectively, in
your Script you do:

x = _['varname']
y = _.getitem('varname', 0)

Cheers,

Evan @ digicool & 4-am