[Zope] Re: Getting a methods parent (in a product)
Peter Bengtsson
peterbe at gmail.com
Sat Jul 23 11:12:54 EDT 2005
> >
> > How can I get a Product instance's _actual_ parent when one of its
> > methods is called? (In other ways: how can I find out, from an
> > instance, where that instance is located without falling prey to
> > acquisition in Zope 2?)
>
> from Acquisition import aq_inner, aq_parent
>
> parent = aq_parent(aq_inner(self))
>
> This will return the true container the instance is set in, not just
> the acquisition parent.
>
What's so bad about
parent = self.aq_parent
?
> jens
>
> _______________________________________________
> Zope maillist - Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
More information about the Zope
mailing list