16 May
2003
16 May
'03
7:51 p.m.
Geir Bækholt wrote at 2003-5-16 10:33 +0200:
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 = object.aq_parent
That usually works, but not always. It may fail, when the object was accessed via acquisition. The other proposal ("getParentNode") may be more reliable (as acquisition context might be cut away) but I am not sure (acquisition rules for a method's "self" are so complex that I always need to think for hours how they work in a concrete situation). Dieter