[Zope] Accessing self in External Methods

Dieter Maurer dieter@handshake.de
Sun, 1 Sep 2002 23:04:15 +0200


ratem@censa.com.br writes:
 > I am using an external method to call wvWare and catalog a M$-Word file content.
 > 
 > The file object is an attribute of my ZClass.
 > The external method is called by a Python Script (PrincipiaSearchSource). 
Then your Python Script should explicitly pass "context" into
your External Method. There, you can access it instances in the normal
way.

There is a magic passing of the context of the External Method
as the first argument, if it is called "self" and the method
is called with precisely one argument less than the required
number of arguments. As you see, the rule is that strange,
that you should use it only when you really need to.
There is no need in a Python Script...


Dieter