[Zope] Re: [Zope-dev] Getting parent within ZClass hierarchy

Jim Washington jwashin@vt.edu
Fri, 09 Feb 2001 08:59:19 -0500


Hi, Arno

I have done something similar to this:

parent_id = container.aq_parent.getId()
parent_title = container.aq_parent.title

I think aq_inner used to be part of this solution, but it does not seem
to be available any more.

-- Jim Washington

Arno Gross wrote:
> 
> Easy question, but I couldn't find the answer.
> How can I access the id (or title) of the parent
> containing my current object?
> 
> E.g.
> 
> NewsContainer
>   |---NewsCategory  ( ZClass - ObjectManager)
>              |---NewsItem (ZClass - CatalogAware)
> 
> I'm looking for a method (Python script) in NewsItem, which give me the id or
> title of its parent.