30 Sep
1999
30 Sep
'99
2:02 p.m.
picasso@videotron.ca wrote:
How can a PythonMethod access an arbitrary object stored in the ZODB.
The same way an External Method does; You have to pass the object (or at least *some* starting object) as a parameter and go from there. The current namespace variable "_" is usually a good bet.
ex: Myfolder myObject myPythonMethod myDTMLMethod
myDTMLMethod: <dtml-var "myObject.attribute">
<params>container</params> return container.myObject.attribute called as <dtml-var "pymethod(Myfolder)"> or <params>_</params> return _.myObject.attribute called as <dtml-var "pymethod(_)">