[Zope] Re: ObjectManagerItem parent
Thierry Florac
thierry.florac@onf.fr
04 Dec 2002 09:56:07 +0100
On Wed, 2002-12-04 at 00:10, Maik Jablonski wrote:
> Clemens Robbenhaar wrote:
> > 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 ;-)
>
> If you want no acquisition context, then .aq_inner.aq_parent is the way
> you should do it,
> that's right. But in most cases you want acquisition, I would guess...;-)
No, what I'd like to get is the "physical" parent of an object : if an
image is stored in a folder, for example, what I want to get is a
pointer to this folder, independently of the way I access this image
(direct request from URL or throught catalog requests).
Thanks,
Thierry