[Zope] ZPT - getting at an object's parent

Joel Burton joel@joelburton.com
Fri, 15 Mar 2002 05:30:02 -0500 (EST)


On Fri, 15 Mar 2002, Max M wrote:

> Joel Burton wrote:
>
> >On Thu, 14 Mar 2002, Tom Nixon wrote:
> >
> >>How do I get at the attributes of an object's parent?
> >>
> >to get property "spam" of the parent of object "foo":
> >
> >foo.aq_parent.spam
> >
>
> Is it not good tone anymore to use:
>
> foo.PARENTS[1].spam  ???

It never was. PARENTS[] is a list in the REQUEST object--you won't find it
if you go looking through obj foo. PARENTS[] shows the parents of the
current REQUEST obj, *not* the PARENTS[] of a selected object, like foo.

-- 

Joel BURTON  |  joel@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant