diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-28 23:34:05 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-28 23:34:05 -0400 |
commit | 3be078425fdcf0d0baee01328a729efc5087a535 (patch) | |
tree | e7782a920a8faeca79b3b25449abc317ac19a5fa | |
parent | 01215cdaef4579b5d0806abd060a2dd90acabf9b (diff) | |
download | sqlalchemy-3be078425fdcf0d0baee01328a729efc5087a535.tar.gz |
- cut out some calls by inlining the calls to get_history()
-rw-r--r-- | lib/sqlalchemy/orm/persistence.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py index b4c31a027..996cc8802 100644 --- a/lib/sqlalchemy/orm/persistence.py +++ b/lib/sqlalchemy/orm/persistence.py @@ -314,9 +314,8 @@ def _collect_update_commands(base_mapper, uowtransaction, col) prop = mapper._columntoproperty[col] - history = attributes.get_state_history( - state, prop.key, - attributes.PASSIVE_NO_INITIALIZE + history = state.manager[prop.key].impl.get_history( + state, state_dict, attributes.PASSIVE_NO_INITIALIZE ) if history.added: params[col.key] = history.added[0] @@ -331,15 +330,15 @@ def _collect_update_commands(base_mapper, uowtransaction, # in a different table than the one # where the version_id_col is. for prop in mapper._columntoproperty.values(): - history = attributes.get_state_history( - state, prop.key, + history = state.manager[prop.key].impl.get_history( + state, state_dict, attributes.PASSIVE_NO_INITIALIZE) if history.added: hasdata = True else: prop = mapper._columntoproperty[col] - history = attributes.get_state_history( - state, prop.key, + history = state.manager[prop.key].impl.get_history( + state, state_dict, attributes.PASSIVE_NO_INITIALIZE) if history.added: if isinstance(history.added[0], @@ -421,8 +420,8 @@ def _collect_post_update_commands(base_mapper, uowtransaction, table, elif col in post_update_cols: prop = mapper._columntoproperty[col] - history = attributes.get_state_history( - state, prop.key, + history = state.manager[prop.key].impl.get_history( + state, state_dict, attributes.PASSIVE_NO_INITIALIZE) if history.added: value = history.added[0] |