[Zope] External Methods nightmare

Dieter Maurer dieter@handshake.de
Tue, 10 Apr 2001 20:49:14 +0200 (CEST)


Felipe Alvarez Harnecker writes:
 > i'm new to External Methods, and i got the following prob.
 > 
 > In folder FOLDER a got 3 method A (dtml) B (Zsql) and C ( external )
 > 
 > the story is that method A call method B. From zope there is no
 > prob. with that but when i call A from C, zope complains that it can't
 > find B.
 > 
 > I't seems that Zope forget that it is in FOLDER.
Almost surely, you call "A" in the wrong way from "C", breaking
the namespace/acquisition chain:

  DTML objects have 2 positional parameters: "client" and "REQUEST".

  When called automatically from DTML, these parameters
  are passed as "None" and "_". This way the namespace
  is passed into the called DTML object.

  If you call a DTML object explicitly, you must make
  sure to pass either a senseful "client" or a senseful "REQUEST".
  Otherwise, a DTML method will have no context at all
  while a DTML document only has its own containment context.


More details in the DTML section of 

  URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html


Dieter