You mean this: print pythoncom.CreateGuid() creates something like {30BD3490-2632-11cf-AD5B-524153480001} It's from the Pythom COM package. I guess all you need is access to that package from inside Zope and an external method would do the trick. Jason James W. Howe writes:
At 07:49 PM 3/8/00 -0500, Jason Spisak wrote:
Zopsters,
I use the Catalog for quite a bit of jumping around the ZODB, and have a 30,000 plus objects in a system. I like the idea of not having to worry about id's conflicting with other numbers that might appear (invoice numbers, employee numbers, etc...) so I don't like to use a counter for ids. [...]
I have the same problem. I want to automatically create objects and I'm currently using the time method. When I bulk add objects, I would get a collision on the time value, so I simply remembered the last id and added 1 to that value. It works for my current needs, but I wish Zope provided a standard mechanism for generating unique id's.
For example, it would actually be nice if Zope provided an implementation of UUID (called GUID by Microsoft). A UUID is a guaranteed unique 64-bit value. It's used in COM, CORBA and other systems which need to have automatically generated guaranteed unique values. The nice thing about UUID's is that they are guaranteed to be unique network wide. In other words, you (supposedly) can't generate a UUID which would ever conflict with a UUID that I generated. It does this by an algorithm which takes into account things like time-of-date, network card address, etc. I don't have the details on the algorithm but I know it is publically available. It would probably best be implemented at the C level.
Just an idea.
James W. Howe mailto:jwh@allencreek.com Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.