<div dir="ltr">For a ticketing system, you could just use the unix timestamp as the ticket id. <br><font face="Courier New, Courier, mono"><strong><br>269-345-460 is my birthday... ( July 15, 1978)<br></strong></font><strong><font size="-1" face="Courier New, Courier, mono"><font color="#cc0000">121-873-549-7 is now.</font></font></strong> (well, when this email was written).<br>
<br>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 &quot;ticket open date/time&quot;.<br>
<br><div class="gmail_quote">On Thu, Aug 14, 2008 at 1:40 AM, Phillip B Oldham <span dir="ltr">&lt;<a href="mailto:phillip.oldham@gmail.com">phillip.oldham@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all. I&#39;m playing with standalone ZODB at the moment trying to get a<br>
better understanding of its use in applications. I come from a<br>
PHP/MySQL background, and I&#39;m taking my first steps with Python at the<br>
same time.<br>
<br>
One of the things I&#39;m not understanding about ZODB is assigning<br>
incremental IDs to objects. For instance, if I were to be writing a<br>
support-ticket system I&#39;d want to give each ticket a unique number,<br>
but one that&#39;s &quot;human-useable&quot; (otherwise you could just use a UUID -<br>
try giving one of those over the phone!).<br>
<br>
Also, how would one add a new item to the db in this way?<br>
<br>
For instance:<br>
<br>
class Ticket(Persistence):<br>
 &nbsp;def __init__(self):<br>
 &nbsp; &nbsp;<a href="http://self.id" target="_blank">self.id</a> = &#39;&#39; # How do I add a new incremental ID here?<br>
<br>
# and later on in the app<br>
<br>
tkt = Ticket()<br>
dbroot[?????] = tkt<br>
<br>
How would one assign a unique ID to the root at that point?<br>
--<br>
Phillip B Oldham<br>
<a href="mailto:phillip.oldham@gmail.com">phillip.oldham@gmail.com</a><br>
+44 (0) 7525 01 09 01<br>
_______________________________________________<br>
Zope maillist &nbsp;- &nbsp;<a href="mailto:Zope@zope.org">Zope@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a><br>
** &nbsp; No cross posts or HTML encoding! &nbsp;**<br>
(Related lists -<br>
&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
</blockquote></div><br><br clear="all"><br>-- <br>Thanks,<br>Derek Wilson<br>
</div>