RE: [SQLObject] request for elaboration on code
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <jws...@ra...> - 2004-02-16 16:22:32
|
>Yes, 'id' (or whatever field '_idName' is for you) is the PK and the value >SQLObject uses to uniquely identify objects in its cache etc. So, for posterity, _idName is the name of the primary key column, and id is the unique value that is associated with a new row. >SQLObject needs to know the ID value for any object, at least so that future >updates and selects can be made (where idName = idValue), and for the >SQLObject cache. So with oids you will still definitely need a way to get any >auto-generated id column values in this method. Based on what I see in DBconnection.py, I understand that the idiom is that we format the SQL, write out the record, then read back and return the unique id to be stored in the in-memory object we are creating. >There are alternatives to doing it by oid, such as pre-selecting the nextval >on the sequence, but using oids seemed to be the least intrusive to >SQLObject's design. I think it would be reasonable to either derive the standard sequence name as you described or accept it in the class definition like _seqName or similar. Nextval could then operate in the (somewhat)same way( that we are currently using oid. Is there organizational resistance to doing it that way? In other words, if I do it myself, will it be accepted into the project? |