For a ticketing system, you could just use the unix timestamp as the ticket id. * 269-345-460 is my birthday... ( July 15, 1978) **121-873-549-7 is now.* (well, when this email was written).
Anyway, these should be pretty easy to give over the phone. They are unique enough that you can take 59 calls a minute, 3599 calls an hour. It can also save you from storing another value "ticket open date/time". On Thu, Aug 14, 2008 at 1:40 AM, Phillip B Oldham <[EMAIL PROTECTED]>wrote: > Hi all. I'm playing with standalone ZODB at the moment trying to get a > better understanding of its use in applications. I come from a > PHP/MySQL background, and I'm taking my first steps with Python at the > same time. > > One of the things I'm not understanding about ZODB is assigning > incremental IDs to objects. For instance, if I were to be writing a > support-ticket system I'd want to give each ticket a unique number, > but one that's "human-useable" (otherwise you could just use a UUID - > try giving one of those over the phone!). > > Also, how would one add a new item to the db in this way? > > For instance: > > class Ticket(Persistence): > def __init__(self): > self.id = '' # How do I add a new incremental ID here? > > # and later on in the app > > tkt = Ticket() > dbroot[?????] = tkt > > How would one assign a unique ID to the root at that point? > -- > Phillip B Oldham > [EMAIL PROTECTED] > +44 (0) 7525 01 09 01 > _______________________________________________ > Zope maillist - Zope@zope.org > http://mail.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://mail.zope.org/mailman/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope-dev ) > -- Thanks, Derek Wilson
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )