summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/dynamic.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-12-06 13:29:13 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-12-06 13:29:13 -0500
commit8423dbcf62284e669c65afc258b0b993f8a66b6e (patch)
treeb714ab56a567e805803eff96707656654ae4e376 /lib/sqlalchemy/orm/dynamic.py
parenta104f9d57d04864b139013632c7d3c7c98ab977c (diff)
downloadsqlalchemy-8423dbcf62284e669c65afc258b0b993f8a66b6e.tar.gz
- shave about a millisecond off of moderately complex save casades.
Diffstat (limited to 'lib/sqlalchemy/orm/dynamic.py')
-rw-r--r--lib/sqlalchemy/orm/dynamic.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/dynamic.py b/lib/sqlalchemy/orm/dynamic.py
index 95a58ee84..710b710a9 100644
--- a/lib/sqlalchemy/orm/dynamic.py
+++ b/lib/sqlalchemy/orm/dynamic.py
@@ -141,7 +141,13 @@ class DynamicAttributeImpl(attributes.AttributeImpl):
c = self._get_collection_history(state, passive)
return attributes.History(c.added_items, c.unchanged_items,
c.deleted_items)
-
+
+ def get_all_pending(self, state, dict_):
+ c = self._get_collection_history(state, True)
+ return (c.added_items or []) +\
+ (c.unchanged_items or []) +\
+ (c.deleted_items or [])
+
def _get_collection_history(self, state, passive=False):
if self.key in state.committed_state:
c = state.committed_state[self.key]
@@ -304,4 +310,4 @@ class CollectionHistory(object):
self.deleted_items = []
self.added_items = []
self.unchanged_items = []
-
+