Re: [SQLObject] Unique ID Number question
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Luke O. <lu...@me...> - 2003-10-02 19:27:48
|
> > Where does it learn that the new Person has an ID of 1? > > I tried the same commands manually and the insert doesn't return the ID. > How does SQLObject know what the ID is? Depends on the database/dbdriver. You'll find the implementation in SQlObject/DBConnection.py, _queryInsertID() for each DBConnection-class. Some Python db interfaces provide a non-standard option for getting this from the cursor (MySQL, SQLite), some require a second query of the database (Postgres using OIDs, for instance). - Luke |