[Zope] Unique object Ids
Philippe Jadin
all@123piano.com
Sun, 24 Mar 2002 13:50:08 +0100
Tom Cameron wrote:
>When I try to render an object I often get something like '<Model instance
>at 02620E00>'
>
>This suggests to me that this object has some kind of unique ID 02620E00
>that identifies this particular instance.
>
>Is there any way that I can query an object to find this id? My aim is to
>find some way to uniquely identify all objects so that I can find them later
>without having to store their entire path.
>
>Tom
>
I asked for this on the zope mailing list a few months ago, and while
it's true there is a unique ID for each zope object, it seems to change
each time you move the object (and probably in other situations) . I'd
recommend to generate your own ID as a property of the object (you could
monkeypatch some base class) and use this instead of the uid provided by
zope. This is imho something that should be included in the zope core,
but a well made monkeypatch can solve the problem in the short term.
hth
Philippe