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

Erik Enge erik+list@esol.no
15 Feb 2001 17:49:24 +0100


[Cyril Elkaim]

| I want to give the id (eventually qualified) of an object and get a
| reference to it. I'm talking about persistent objects inside the
| ZODB.

What do you need the reference for?  How are you going to use it?  And
when you're talking about «inside ZODB», does that mean that you're
not using Zope to access it?
 
| For example it should be interesting to walk through the database
| using only DOM methods. Is that the case?

Shouldn't be a problem.  Also have a look at objectValues(),
objectIds() and objectItems() in lib/python/OFS/ObjectManager.py;
around line 320.  They could save you some time.