[Zope-dev] Accessing parent object

Evan Simpson evan@digicool.com
Thu, 24 Feb 2000 08:34:26 -0600


----- Original Message -----
From: Robert Sander <gurubert@gurubert.de>
> Now I have my classes subclassed from Acquistion.Implicit, therefore I do
not
> need to aq_acquire, which is explicit, I think.

Yep.  In Zope, at least, it's still handy when the thing you are acquiring
has a non-identifier name.

> The part where I begin to wonder is my third class:
>
> class Three(Implicit, Persistent, RoleManager, OFS.SimpleItem.Item):
>     def method(self):
>         print self.aq_acquire("something")
>
> whose objects are children to objects of Two. I do not get AttributeErrors
> here, even if I do not do "three = three.__of__(two)" ...

When you say "are children", do you mean that you are doing something like
"aTwo.aThree.method()"?  If so, the process of fetching 'aThree' from 'aTwo'
gives it an acquisition wrapper, making explicit wrapping unnecessary.

Cheers,

Evan @ 4-am & digicool