[Zope] Different external method and acquisition syntax question.

Dieter Maurer dieter@handshake.de
Tue, 7 Aug 2001 22:54:55 +0200 (CEST)


jelle writes:
 > I can't seem to find an answer to my external method and acquisition
 > syntax question so here goes:
 > 
 > I have three objects:
 > 
 > python script(alpha) -> external method(beta) -> zsql(delta)
 > 
 > The python script "alpha" is in  subfolder "/proj/py_script".
 > The external method "beta" is in subfolder "/proj/ex_python".
 > the zsql object "delta" is in subfolder "/proj/db".
 > 
 > The python script "alpha" is invoked and calls:
 > 
 >   context.ex_python.beta()
 > 
 > External method "beta" is fired up and  calls:
 > 
 >   self.db.delta()
Hm, strange!

  It appears as if "self" would not be what you (and I) expect!

  We both expect it to be "proj.py_script.ex_python".
  But this, of course, has a "db" attribute.

I would try to pass it explicitely, because the rules
for passing "self" automatically are magical...

    context.ex_python.beta(context)

If this should not work or you are curious, Shane has
a very nice small External Method that allows to analyse
the acquisition structure of an object: "showaq"
(search the searchable mailing list archives).


Dieter