[Zope] Zoo guestbook example.

Dieter Maurer dieter@handshake.de
Mon, 19 Feb 2001 19:57:29 +0100 (CET)


Ignacio Valdes writes:
 > Dieter Maurer wrote:
 > > Where does your "self" come from?
 > I'm from Georgia originally, but I grew up in Texas :-)
I meant the question seriously.

Let's go a step back.

The Zope book is based on Zope 2.3, neither on 2.2.2 nor 2.2.4.

"context" is a new concept from PythonScripts. As of Zope 2.3,
they are "in the core". I am not sure, whether you can use
PythonScript with Zope 2.2.x. There may be problems.
I would not expect big differences between Zope 2.2.2 and 2.2.4.

If you do not use PythonScripts, you would need an ExternalMethod.
An ExternalMethod will only get automatically a reference to the object for
which is is called, if the name is "self" and it is the first
parameter.

Furthermore, if you call such a method, then the self is passed
automatically only, if the call is precisely with one parameter
less than that required by the method.
In all other cases, you must pass the object explicitly.

Your problem description indicates that you have called the method
with enough parameters that the auto-passing of "self" did not
happen. Instead "self" appears to have got a string as value.

If this description really matches your case, then
call the method with '<dtml-XXXX "method(this(),further parameters)">'.



Dieter