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

Erik Enge erik+list@esol.no
15 Feb 2001 17:14:09 +0100


[Cyril Elkaim]

| 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.

yourobject.getParentNode() should do the trick.

Have a read at lib/python/OFS/ZDOM.py
 
| Another question how can I get a reference of any object in OBJECT
| system,

I'm not quite sure what you mean, could you elaborate please?  Do you
mean like you want to search for any object and get a reference
(kewords: ZCatalog, getobject and searchResults) or just to have a
HTML link (keywords: relative_url and absolute_url) or what?  :)