[Zope-dev] Getting the parent of a container in a Python Script

Cyril Elkaim cyril.elkaim@free.fr
Thu, 15 Feb 2001 16:06:41 +0100 (CET)


       Hi all,

My question is in the title. I think I'm stupid because I have really searched
 anywhere, and found nothing. The answer is certainly trivial but too many hours
you know... :-)

I'm able to get all the children of the current container or context but unable
to get its parent. Maybe it's silly but a 'parent' property for all the 
objects seems to me a good idea. Of such a property may already exist but what is
its name ?

Of course I have tried REQUEST.PARENTS[0] but this is the parent inside the
URL, I'm searching the PARENT inside the object system.

Another question how can I get a reference of any object in OBJECT system,
I've tried unrestrictedTraverse but it seems very 'restrictive' :-)

Aside from my problems Zope rocks really.

    Thanks in advance
    Cyril