]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- redefined how the mapper determines primary keys. this is to help with the new...
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 21 May 2007 00:22:30 +0000 (00:22 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 21 May 2007 00:22:30 +0000 (00:22 +0000)
commit9706ef4ab8beacd16bcdaa29ef11179982b796a6
treeacd508c43d63479362218c7a3ebf1963a1074bcd
parent694a24be92b7976959f97c7e0718e68dca9d98eb
- redefined how the mapper determines primary keys.  this is to help with the new deferred
polymorphic loading.  it takes stock of all the primary keys of all of its tables in all cases,
including when a custom primary key is sent, to maximize its chances of being able to INSERT into each table.
then, whether or not the custom primary key is sent, it gathers together columns which are equivalent via
a foreign key relationship to each other or via a common parent column, similarly to how Join does it.
this continues along the path first set up from [ticket:185].  so primary keys of mappers are always
going to be "minimized" as far as number of columns.  finally, the list of pk cols is normalized to the
mapped table.  this becomes the mapper's "primary key" and is distinct from all the per-table pk column
collections.
- added "deferred poly load" versions to magazine test, cut down on table recreates in polymorph test.
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql.py
test/orm/inheritance/magazine.py
test/orm/inheritance/manytomany.py
test/orm/inheritance/polymorph.py
test/orm/inheritance/polymorph2.py