]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- cut out some calls by inlining the calls to get_history()
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 29 Jun 2014 03:34:05 +0000 (23:34 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 29 Jun 2014 03:34:39 +0000 (23:34 -0400)
lib/sqlalchemy/orm/persistence.py

index 49d9d11b9a4de1f1eed0e15b75f331b98d5385d9..95a37ef2cb0ae58c2d8bff96da0e84f45a7e5bd6 100644 (file)
@@ -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],
@@ -426,8 +425,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]