[Zope] How to obtain the parent-object from an Zope-object

Dieter Maurer dieter@handshake.de
Fri, 16 May 2003 22:10:04 +0200


Thierry FLORAC wrote at 2003-5-16 14:38 +0200:
 > On Friday 16 May 2003 10:33, Geir B=E6kholt wrote:
 > > On  Fri, 16 May 2003 08:55:23 +0200 GMT (..8:55 where i live(GMT+2) =
)
 > > Wim Bekker asked the Zope mailinglist about the following:
 > >
 > > WB> How can I obtain the 'parent' object in Zope with python (script=
)?
 > >
 > > myparent =3D object.aq_parent
 >=20
 >=20
 > Hi,
 >=20
 > Maybe I'm wrong, but I've read here and there that the correct syntax =
should=20
 > be :
 >=20
 >   parent =3D object.aq_inner.aq_parent

"aq_inner" is protected, you cannot use it in TTW code.

"getParentNode" (suggested by someone else) may work
(though I am not sure).


Dieter