[Zope] Unique ID's ?

Tom Cameron tom@mooball.com
Thu, 1 Nov 2001 08:31:34 +1000


I had this problem recently and I solved it (sort of) this way:

I wrote a method that created a unique id I called CID from the
time+userIP+random number and then made that a property of the object each
time an instance was created.

Then I wrote some methods to walk the tree and return a dictionary of CID:ID
pairs so I could easily translate them back.

This then lead to some interesting trouble - if I copy an item do I want
this id to be copied or reset to a new value? I am presently trying to
modify the copy/paste methods so that it resets the id after a copy. Hope to
have that solved soon.

Tom

=> -----Original Message-----
=> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of marc
=> lindahl
=> Sent: Thursday, 1 November 2001 3:20 AM
=> To: Philippe Jadin; zope
=> Subject: Re: [Zope] Unique ID's ?
=>
=>
=> You could use the 'thread safe counter' product, it's part of
=> ZopeGUD, used
=> for a similar purpose in there.
=>
=> > From: Philippe Jadin <philippe@123piano.com>
=> > Date: Wed, 31 Oct 2001 10:08:10 +0100
=> > To: zope <zope@zope.org>
=> > Subject: [Zope] Unique ID's ?
=> >
=> > Hello,
=> >
=> > After some deep searches about the subject, I found that zope has no
=> > real unique ID's.
=> >
=> > For a particular application (where we can't use the object "url" as an
=> > ID as ojects will move), I'd like to assign a unique_id
=> property to each
=> > object whenever they are added (the ID must be really really unique).
=> >
=> > Is there already a patch that do that ? Is there a reason why zope
=> > doesn't provide this facility?
=> >
=> > Thanks in advance,
=> >
=> > Philippe
=> >
=> > _______________________________________________
=> > Zope maillist  -  Zope@zope.org
=> > http://lists.zope.org/mailman/listinfo/zope
=> > **   No cross posts or HTML encoding!  **
=> > (Related lists -
=> > http://lists.zope.org/mailman/listinfo/zope-announce
=> > http://lists.zope.org/mailman/listinfo/zope-dev )
=>
=>
=> _______________________________________________
=> Zope maillist  -  Zope@zope.org
=> http://lists.zope.org/mailman/listinfo/zope
=> **   No cross posts or HTML encoding!  **
=> (Related lists -
=>  http://lists.zope.org/mailman/listinfo/zope-announce
=>  http://lists.zope.org/mailman/listinfo/zope-dev )
=>