]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Allow immediateload to use_get for recursive call
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 20 Apr 2021 18:09:51 +0000 (14:09 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 20 Apr 2021 18:11:44 +0000 (14:11 -0400)
commit4b9e2db51a7e40ff2c4212fe8476fe0c7ba21ca0
tree326cb26f0c267be96a23a20432f313b566045215
parent3580e6ed33451505e2462ffcb1beaf96f851b011
Allow immediateload to use_get for recursive call

Altered some of the behavior repaired in :ticket:`6232` where the
``immediateload`` loader strategy no longer goes into recursive loops; the
modification is that an eager load (joinedload, selectinload, or
subqueryload) from A->bs->B which then states ``immediateload`` for a
simple manytoone B->a->A that's in the identity map will populate the B->A,
so that this attribute is back-populated when the collection of A/A.bs are
loaded. This allows the objects to be functional when detached.

Fixes: #6301
Change-Id: I8505d851802c38ad8ad4e2fab9030f7c17089e9d
doc/build/changelog/unreleased_14/6301.rst [new file with mode: 0644]
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/strategy_options.py
test/orm/test_eager_relations.py
test/orm/test_immediate_load.py