summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-04-26 18:50:05 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-08-23 12:46:41 -0400
commit2fc7078a08db057ea7e43991205aaee5562d7fd3 (patch)
treefb4f227072d50d8e493b988832fc0b4c2771664b /lib/sqlalchemy/orm/attributes.py
parente429ef1d31343b99e885f58a79800ae490155294 (diff)
downloadsqlalchemy-2fc7078a08db057ea7e43991205aaee5562d7fd3.tar.gz
Run eager loaders on unexpire
Eager loaders, such as joined loading, SELECT IN loading, etc., when configured on a mapper or via query options will now be invoked during the refresh on an expired object; in the case of selectinload and subqueryload, since the additional load is for a single object only, the "immediateload" scheme is used in these cases which resembles the single-parent query emitted by lazy loading. Change-Id: I7ca2c77bff58dc21015d60093a88c387937376b2 Fixes: #1763
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
-rw-r--r--lib/sqlalchemy/orm/attributes.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 2f54fcd32..d50eab03e 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -702,7 +702,8 @@ class AttributeImpl(object):
if not passive & CALLABLES_OK:
return PASSIVE_NO_RESULT
- if key in state.expired_attributes:
+ if self.accepts_scalar_loader and \
+ key in state.expired_attributes:
value = state._load_expired(state, passive)
elif key in state.callables:
callable_ = state.callables[key]