[Zope] How to access object directly

Stefan Franke sfranke@cdc-group.com
Sat, 27 Feb 1999 14:50:57 +0100


How do I get a Zope object stored in the database given its path, 
let's say "\folder1\folder2\image" from inside an external function
or product method?

Something like 
   object = BOBO_machinery (path)

Of course I could use self.folder1.folder2.image due to aquisition,
but only if the names are unique on the object's path.

In the moment I'm about to use something like
    from Main import app
    path = string.split (path, "/")
    object = reduce (getattr, path, app)

but this is not very nice. I'm sure there is a simpler solution.

Stefan