]> 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:00:27 +0000 (10:00 -0400)
commit9f3539b1745cbb287a1338812872d27cde4ebf24
tree356aba433707630167319294201f657c4817984e
parent2c34d2503a17316cae3282192405b9b9d60df6fe
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
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