[Zope] How to generate an Object ID automatically

Andy McKay andym@ActiveState.com
Fri, 15 Sep 2000 11:28:55 -0700


There are many different options one simple way I used at the beginning was
to base it on date and time:

<dtml-call "REQUEST.set('id','Faqs'+_.str(_.int(ZopeTime())))">
<dtml-with "Faqs.createInObjectManager(REQUEST['id'], REQUEST)">

...

This creates an id along the lines of Faqs958889275

----- Original Message -----
From: "zopist" <zopist@matrixware.at>
To: <zope@zope.org>
Sent: Friday, September 15, 2000 11:09 AM
Subject: [Zope] How to generate an Object ID automatically


dear zopists,
im a zope newbie and i have one of those little problems ppl like me can
spend hours on ...
i just built my first ZClass and now im trying to automatically assign a
generated ID to an instance of this class in the -add method.
i want to generate the id because there is no unique fieldvalue available
and i dont want to have the users get stuck on this point.

another problem i encountered is that when i try to add an instance in a
folder i get an authentication box where no valid login is accepted

i would really much apreciate if someone could help.

Francisco (chico) Webber