[Zope] Acquisition not working as expected

Dieter Maurer dieter at handshake.de
Fri Mar 3 13:52:53 EST 2006


Roman Klesel wrote at 2006-3-3 08:20 +0100:
> ...
>> In your case, the method "test3" is not defined by "Folder"
>> but by what you call "your product instance" (still a wrong term!).
>> Therefore, its "self" is necessarily an instance of "your product"
>> (I keep your wrong term). And "self.getId()" gives (consequently)
>> its (and not the Folder's) id.
>> 
>
>What would then be the right term? (I suspect I'll have to discuss this further)

An instance of my class defining "test3".

Note again:

  A product is an extension mechanism for Zope usually
  defining and registering various classes to be instantiated
  as (what I call) site building objects.

  Thus, there is no product instance (in your Zope hierarchy).
  Instead you have instances of classes defined in your product.

  I would give the classes articifical names, say "C", "C1", "C2" ...

E.g. a perfect description of your problem could have been:

  In a product I defined a class "C" deriving from
  "Folder" with method "test3" which prints "self.getId()".

  I can call "test3" (via acquistion) on objects contained
  in an instance "I" of "C". However, the printed id is
  always the id of "I" and not that of the object on which "test3"
  has been called on.

-- 
Dieter


More information about the Zope mailing list