[Zope] Re: ObjectManagerItem parent

Clemens Robbenhaar zope@zope.org
Tue, 3 Dec 2002 19:30:16 +0100


Maik Jablonski writes:
 > Thierry Florac wrote:
 > > Given an object accessed directly (for example, through a call to
 > > Catalog().getObject()), how can I get access to his parent folder in a
 > > Python script or a Zope product ??  What the property or method name
 > > pointing to the folder the object ?
 > 
 > try:
 > 
 > .aq_parent

 Well, in a Zope product on the file system code.

Maybe even '.aq_inner.aq_parent' is better to remove any acquisition
context?
(Thierry: You can look this up in the ZopeDevelopers guide, chapter
Acquisition, if You wonder what this means ;-)

 In a Python script, the aq_* variables are not accessible. 
One could use an external method or fumble with
'getPhysicalPath' and 'restrictedTraverse', which is both somewhat
cumbersome, however.