]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
(no commit message)
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 14 Oct 2005 07:21:35 +0000 (07:21 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 14 Oct 2005 07:21:35 +0000 (07:21 +0000)
lib/sqlalchemy/objectstore.py

index 048c01d283289a2aba4a1236c6424840e09a56dd..17fb1b794e4db54d9614800dffc393a43d48163e 100644 (file)
@@ -374,14 +374,18 @@ class UOWTask(object):
         self.iscircular = False
 
     def append(self, obj, listonly = False):
+        """appends an object to this task, to be either saved or deleted
+        depending on the 'isdelete' attribute of this UOWTask.  'listonly' indicates
+        that the object should only be processed as a dependency and not actually saved/deleted.
+        if the object already exists without the 'listonly' flag, it is kept as is."""
         self.objects[obj] = listonly and self.objects.get(obj, True)
         #print "Task " + str(self) + " append object " + obj.__class__.__name__ + "/" + repr(id(obj)) + " listonly " + repr(listonly) + "/" + repr(self.objects[obj])        
         
-    def requires_save(self, obj):
-        self.objects[obj] = False
-        #print "Task " + str(self) + " requires " + (self.isdelete and "delete " or "save ") + obj.__class__.__name__ + "/" + repr(id(obj))
-        
     def execute(self, trans):
+        """executes this UOWTask.  saves objects to be saved, processes all dependencies
+        that have been registered, and deletes objects to be deleted.  If the UOWTask
+        has been marked as "circular", performs a circular dependency sort which creates 
+        a subtree of UOWTasks which are then executed hierarchically."""
         if self.iscircular:
             #print "creating circular task for " + str(self)
             task = self._sort_circular_dependencies(trans)