]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- removed redundant get_history() method
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 1 Apr 2008 03:16:47 +0000 (03:16 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 1 Apr 2008 03:16:47 +0000 (03:16 +0000)
- the little bit at the bottom of _sort_circular_dependencies is absolutely covered by test/orm/cycles.py !  removing it breaks the test as run on PG.

lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/unitofwork.py

index 5d2b21ddd06b31bf3c4f4906426eaa0c25b50d8c..152534d76f59692da544e7be54cc6e5c823f604f 100644 (file)
@@ -495,14 +495,11 @@ class CollectionAttributeImpl(AttributeImpl):
         return [y for y in list(collections.collection_adapter(item))]
 
     def get_history(self, state, passive=False):
-        if self.key in state.dict:
-            return _create_history(self, state, state.dict[self.key])
+        current = self.get(state, passive=passive)
+        if current is PASSIVE_NORESULT:
+            return (None, None, None)
         else:
-            current = self.get(state, passive=passive)
-            if current is PASSIVE_NORESULT:
-                return (None, None, None)
-            else:
-                return _create_history(self, state, current)
+            return _create_history(self, state, current)
 
     def fire_append_event(self, state, value, initiator):
         if self.key not in state.committed_state and self.key in state.dict:
@@ -533,13 +530,6 @@ class CollectionAttributeImpl(AttributeImpl):
         for ext in self.extensions:
             ext.remove(instance, value, initiator or self)
 
-    def get_history(self, state, passive=False):
-        current = self.get(state, passive=passive)
-        if current is PASSIVE_NORESULT:
-            return (None, None, None)
-        else:
-            return _create_history(self, state, current)
-
     def delete(self, state):
         if self.key not in state.dict:
             return
index 1676eeb22cd83aa26a0d7b299f09833048a1e140..66b68770d619ab87ce0d08ded2aa363c65d45657 100644 (file)
@@ -762,11 +762,11 @@ class UOWTask(object):
             make_task_tree(head, t, {})
 
         ret = [t]
+
+        # add tasks that were in the cycle, but didnt get assembled
+        # into the cyclical tree, to the start of the list
         for t2 in cycles:
             if t2 not in used_tasks and t2 is not self:
-                # add tasks that were in the cycle, but didnt get assembled
-                # into the cyclical tree, to the start of the list
-                # TODO: no test coverage for this !!
                 localtask = UOWTask(self.uowtransaction, t2.mapper)
                 for state in t2.elements:
                     localtask.append(state, t2.listonly, isdelete=t2._objects[state].isdelete)