From: Mike Bayer Date: Fri, 14 Oct 2005 07:21:35 +0000 (+0000) Subject: (no commit message) X-Git-Tag: rel_0_1_0~544 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=912fe3f4554e45b7abdef6d0b6e243564e827cf5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git --- diff --git a/lib/sqlalchemy/objectstore.py b/lib/sqlalchemy/objectstore.py index 048c01d283..17fb1b794e 100644 --- a/lib/sqlalchemy/objectstore.py +++ b/lib/sqlalchemy/objectstore.py @@ -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)