[Zope] Getting an object from it's id
Erik Enge
erik+list@esol.no
23 Jan 2001 14:12:13 +0100
[geofstro@monaco.mc]
| Is there a Zope API method that will allow me to get an object from
| it's id, or can I write a simple Python method to do it, or am I
| missing something even more obvious?
Well, sometimes objectItems or objectValues can be the right ones to
use. Other times, (in Python Products at least) you use _getOb() to
fetch the object for you.
Let's say you have this object structure:
/Folder1
/Folder2
If you (in Python code) have Folder1 in the namespace, as self for
example, you can say object=self._getOb('Folder2'), and ṿila. :)
Don't know how you would do that in DTML, though.