[Zope] Lets try this again - auto-creation

Alexander Staubo alex@mop.no
Sat, 17 Jul 1999 23:33:18 +0200


You can store a "last ID" counter as an int property on the top-level
folder, and increment that for every object you create.

Under Zope2 the counter must be thread-safe, which means you've got to
borrow of Zope's global -- I think -- thread locks.

--
Alexander Staubo             http://www.mop.no/~alex/
"He could open a tin of sardines with his teeth, strike a Swan Vestas
on his chin, rope steers, drive a steam locomotive and hum all the
works of Gilbert and Sullivan without becoming confused or breaking
down in tears."
--Robert Rankin, _The Book of Ultimate Truths_

>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On
>Behalf Of Bruce
>C. Dillahunty
>Sent: 17. juli 1999 22:30
>To: zope@zope.org
>Subject: [Zope] Lets try this again - auto-creation
>
>
>OK, since the last round seemed to be roundly ignored :-)
>
>Does anybody know of a way to create a ZClass object without
>entering an
>"ID"... I want the user to create an object, and the ID be
>"autocreated" (a
>random number, the date/time, whatever). I'll be accessing
>them through a
>ZCatalog searching on properties, creation date, etc. and
>don't care about the
>unique ID.
>
>Any suggestions?
>
>Thanks,
>Bruce
>--
>Bruce C. Dillahunty
>Peachbush Enterprises
>bdillahu@mindspring.com
>
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://www.zope.org/mailman/listinfo/zope
>
>(For developer-specific issues, use the companion list,
>zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>