[Zope] a question on external method arguments

Steve Spicklemire steve@spvi.com
Mon, 13 Dec 1999 09:29:37 -0500 (EST)


Hi Guido,

>>>>> "Guido" == Guido A J Stevens <gyst@nfg.nl> writes:

    Guido> I'd like to use an external Python method to reference it's
    Guido> caller's object id. Broken down to the simplest example:

    Guido> Can anybody explain to me, why I need to copy the "id"
    Guido> variable to a locally scoped "myid" for this to work? And
    Guido> what is the logic that makes the external method return
    Guido> self instead of its input argument?

I think You actually did more than just copy the 'id'. In a "DTML Document"
id is a "method" that needs to be called to get the actual id.
I believe that when you say

let x=y

Zope checks to see if 'y' is callable, and if so, it is called and 
'x' is set to be the result of that invocation.

try:
<p>
This is the <!--#var id--> Document.<br>
My id is reported to be:<dtml-var "testid(id())"><br>
</p>

and see if that works for you.

-steve