Tres Seaver wrote:
The actual issue is that attribute access will break if you have an
unwrapped object; 'aq_parent(foo)' will return 'None' in that case.
AttributeError: aq_parent
AttributeEror: None has no attribute "myattribute"
Take your pick I guess ;-)
*grinz*
Chris
--
Simplistix -
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jens Vagelpohl wrote:
>
> On 23 Jul 2005, at 16:12, Peter Bengtsson wrote:
>
>>> 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
>>> t
On 23 Jul 2005, at 16:12, Peter Bengtsson wrote:
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
Two things:
- simply us
> >
> > 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