[Zope] Calling methods on products

Dieter Maurer dieter at handshake.de
Wed Oct 8 15:09:40 EDT 2003


Richard Jennings wrote at 2003-10-8 00:00 +0200:
 > I have a Zcatalog in which I can add actors successfully.  I can also add a product
 > for serving sequential tokens.  My intent is to use the tokens to id the actors in
 > the actor constructor. My problem is that I don't know how to get the constructor to
 > call the getToken() method on the token generator.
 > I thought container.generator.getToken() should do it but I get a keyError saying
 > non-existent 'generator.getToken'.  The generator is subclassed from SimpleItem and
 > also Acquisition.Implicit.

The description is a bit confusing...

Usually, "container.generator.getToken" would *never* raise
a "KeyError, non-existent 'generator.getToken'".

Please look at the traceback. It tells you where (precisely) the
exception is raised. Almost surely, it does not come from where
you expect (now).

If necessary, come back with the traceback, the *precise* (!)
"Error Type" and "Error Value" and the code identified by
the last line of the traceback.


Dieter



More information about the Zope mailing list