]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Allow SQL expressions to be set on PK columns
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 20 Sep 2016 15:33:16 +0000 (11:33 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 20 Sep 2016 15:33:16 +0000 (11:33 -0400)
commitf8ecdf47f0975b8b4e357fde2008d9aae8c50239
tree3efea46680fc5ca957387542f21b5e52eaf1a737
parent881369b949cff44e0017fdc28d9722ef3c26171a
Allow SQL expressions to be set on PK columns

Removes an unnecessary transfer of modified PK column
value to the params dictionary, so that if the modified PK column
is already present in value_params, this remains in effect.  Also
propagate a new flag through to _emit_update_statements() that will
trip "return_defaults()" across the board if a PK col w/ SQL expression
change is present, and pull this PK value in _postfetch as well assuming
we're an UPDATE.

Change-Id: I9ae87f964df9ba8faea8e25e96b8327f968e5d1b
Fixes: #3801
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/orm/persistence.py
test/orm/test_naturalpks.py
test/orm/test_versioning.py