[Zope] Calling a method with an unusual name.
Paul Erickson
erickson@kaivo.com
Tue, 30 Apr 2002 16:04:31 -0600
Matt Gregory wrote:
>I am forced to name all my zope methods with the extension .dtml because M$
>word refuses to save the files in WebDAV unless they have an extension.
>This creates a problem when I try to call a python expression from DTML:
><dtml-var "something.dtml"> comes back with "global name something not
>found".
>
>How do I call documents with an extension?
>
>example:
><dtml-var "phys_petoverview2.dtml()">
>
>
Using the "name" convention:
<dtml-var phys_petoverview2.dtml>
Or
<dtml-var name="phys_petoverview2.dtml">
Or, using the "expr" convention:
<dtml-var "_['phys_petoverview2.dtml']">
Or
<dtml-var expr="_['phys_petoverview2.dtml']">
You have to look it up in the _ variable, since python interprets the
'.' as meaning an attribute of 'something'.
-Paul