diff options
| author | Diana Clarke <diana.joan.clarke@gmail.com> | 2016-04-05 18:58:21 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-04-06 13:28:25 -0400 |
| commit | bef15a950ec4140479bc244f9ca57b5da7c9bb3f (patch) | |
| tree | 79ed72593990bb7ba482fabed575aaa8acbd815b /lib/sqlalchemy/orm/state.py | |
| parent | fdb6ab6a1d5d55d900c388e039835c6433032977 (diff) | |
| download | sqlalchemy-bef15a950ec4140479bc244f9ca57b5da7c9bb3f.tar.gz | |
- don't load deferred columns on unexpire for merge with load=False,
fixes #3488
Change-Id: Ic9577b800e4a4e2465ec7f3a2e95bd231f5337ee
Co-Authored-By: Mike Bayer <mike_mp@zzzcomputing.com>
Diffstat (limited to 'lib/sqlalchemy/orm/state.py')
| -rw-r--r-- | lib/sqlalchemy/orm/state.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/state.py b/lib/sqlalchemy/orm/state.py index 1ad09ee83..2704367f9 100644 --- a/lib/sqlalchemy/orm/state.py +++ b/lib/sqlalchemy/orm/state.py @@ -485,6 +485,10 @@ class InstanceState(interfaces.InspectionAttr): if self.callables: self.callables.pop(key, None) + def _copy_callables(self, from_): + if 'callables' in from_.__dict__: + self.callables = dict(from_.callables) + @classmethod def _instance_level_callable_processor(cls, manager, fn, key): impl = manager[key].impl @@ -537,7 +541,7 @@ class InstanceState(interfaces.InspectionAttr): self.manager.dispatch.expire(self, None) - def _expire_attributes(self, dict_, attribute_names): + def _expire_attributes(self, dict_, attribute_names, no_loader=False): pending = self.__dict__.get('_pending_mutations', None) callables = self.callables @@ -545,6 +549,12 @@ class InstanceState(interfaces.InspectionAttr): for key in attribute_names: impl = self.manager[key].impl if impl.accepts_scalar_loader: + if no_loader and ( + impl.callable_ or + key in callables + ): + continue + self.expired_attributes.add(key) if callables and key in callables: del callables[key] |
