]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ensure states with null m2o FK value are still populated by selectinloader
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 30 Sep 2019 13:55:40 +0000 (09:55 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 30 Sep 2019 14:03:06 +0000 (10:03 -0400)
commit5a06c3f317a5d396f693f1f74de55d32ed41c914
treecd8876a880c45580963f405874ee2dc6d01fd6b1
parent2808efb01af21602ee1650c3b5d987273ee65ea0
Ensure states with null m2o FK value are still populated by selectinloader

Fixed regression in selectinload loader strategy caused by #4775 (released
in version 1.3.6) where a many-to-one attribute of None would no longer be
populated by the loader.  While this was usually not noticeable due to the
lazyloader populating None upon get, it would lead to a detached instance
error if the object were detached.

Fixes: #4872
Change-Id: I18466841683111643810ebc4331376df38c4767b
(cherry picked from commit 9f3539b1745cbb287a1338812872d27cde4ebf24)
doc/build/changelog/unreleased_13/4872.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategies.py
test/orm/test_attributes.py
test/orm/test_selectin_relations.py