]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Use the "committed" values when extracting many-to-one lazyload value
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 8 May 2016 06:21:57 +0000 (02:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 8 Jun 2016 16:57:21 +0000 (12:57 -0400)
commitc99fc44e170be61696206872701ff75e4c8a3711
tree6bd437739570339483d591ce48158ef2a5465214
parent65b3f4aaa072438006f90033a413f10b911ba717
Use the "committed" values when extracting many-to-one lazyload value

The scalar object set() method calls upon the lazy loader
to get at the "old" value of the attriute, however doesn't
ensure that the "committed" value of the foreign key attributes
is used.  If the user has manipulated these attributes and they
themselves have pending, non committed changes, we get the
"new" value which these attributes would have set up if they
were flushed.  "old" vs "new" value is always about how the
value has changed since the load, so we always have to use the
DB-persisted values for everything when looking for "old".

Change-Id: I82bdc40ad0cf033c3a98f3361776cf3161542cd6
Fixes: #3708
doc/build/changelog/changelog_11.rst
doc/build/changelog/migration_11.rst
lib/sqlalchemy/orm/attributes.py
test/orm/test_load_on_fks.py