473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Trying ZODB, background in Relational: mimic auto_increment?

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?
Aug 14 '08 #1
0 709

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

49
by: Paul Rubin | last post by:
I've started a few threads before on object persistence in medium to high end server apps. This one is about low end apps, for example, a simple cgi on a personal web site that might get a dozen...
10
by: ls | last post by:
Hi All, I looking for help with ZODB data export to text file. I have file Data.fs (file becomes from Plone CMS) and I have to display content structure, data like intro, body of article, etc...
1
by: Harald Armin Massa | last post by:
Hello, I am using ZODB "standalone" in version 3.3.1 within some application. Now I learn that the 3.3.x branch of ZODB is "retired". No problem so far, everything is running fine. BUT......
3
by: Rene Pijlman | last post by:
I have a productional Linux web server with a Python/Zope/Plone. Now I'd like to install a non-Zope Python/ZODB application on the same server. What is the recommended way of doing that? Option...
5
by: vd12005 | last post by:
Hello, While playing to write an inverted index (see: http://en.wikipedia.org/wiki/Inverted_index), i run out of memory with a classic dict, (i have thousand of documents and millions of terms,...
2
by: Petra Chong | last post by:
Hello all I am using Python 2.3 and ZODB (without the rest of Zope) with the following pattern: * One process which writes stuff to a ZODB instance (call it test.db) * Another process which...
10
by: teddysnips | last post by:
SQL Server 2000 (DDL below) If I try to run this code in QA: SET IDENTITY_INSERT tblAdminUsers ON INSERT INTO tblAdminUsers (fldUserID, fldUsername, fldPassword, fldFullname,
17
by: Aaron Watters | last post by:
I've been poking around the world of object-relational mappers and it inspired me to coin a corellary to the the famous quote on regular expressions: "You have objects and a database: that's 2...
2
by: Jean-Paul Calderone | last post by:
On Thu, 14 Aug 2008 05:22:35 -0700 (PDT), Phillip B Oldham <phillip.oldham@gmail.comwrote: Here's one way class Sequence(Persistence): def __init__(self): self.current = 0 def next(self):...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.