summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/dependency.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-06-22 22:23:57 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-06-22 22:23:57 +0000
commitad7ffd767d26aef8caba3e52b8c3c1114ec6709c (patch)
tree8039bb3553aa64a6710cf37a442338f9e9412605 /lib/sqlalchemy/orm/dependency.py
parent0e0cedaf9dc085f61949fbe93f389f5a1f5b9cf8 (diff)
downloadsqlalchemy-ad7ffd767d26aef8caba3e52b8c3c1114ec6709c.tar.gz
fixes to inheritance firing off dependency processors correctly + unittest
Diffstat (limited to 'lib/sqlalchemy/orm/dependency.py')
-rw-r--r--lib/sqlalchemy/orm/dependency.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/sqlalchemy/orm/dependency.py b/lib/sqlalchemy/orm/dependency.py
index 067e842c3..6eca75ae1 100644
--- a/lib/sqlalchemy/orm/dependency.py
+++ b/lib/sqlalchemy/orm/dependency.py
@@ -85,7 +85,7 @@ class DependencyProcessor(object):
class OneToManyDP(DependencyProcessor):
def register_dependencies(self, uowcommit):
if self.post_update:
- stub = MapperStub(self.mapper)
+ stub = MapperStub(self.parent, self.mapper, self.key)
uowcommit.register_dependency(self.mapper, stub)
uowcommit.register_dependency(self.parent, stub)
uowcommit.register_processor(stub, self, self.parent)
@@ -179,7 +179,7 @@ class OneToManyDP(DependencyProcessor):
class ManyToOneDP(DependencyProcessor):
def register_dependencies(self, uowcommit):
if self.post_update:
- stub = MapperStub(self.mapper)
+ stub = MapperStub(self.parent, self.mapper, self.key)
uowcommit.register_dependency(self.mapper, stub)
uowcommit.register_dependency(self.parent, stub)
uowcommit.register_processor(stub, self, self.parent)
@@ -249,7 +249,7 @@ class ManyToManyDP(DependencyProcessor):
# if we are the "backref" half of a two-way backref
# relationship, let the other mapper handle inserting the rows
return
- stub = MapperStub(self.mapper)
+ stub = MapperStub(self.parent, self.mapper, self.key)
uowcommit.register_dependency(self.parent, stub)
uowcommit.register_dependency(self.mapper, stub)
uowcommit.register_processor(stub, self, self.parent)
@@ -304,7 +304,7 @@ class AssociationDP(OneToManyDP):
# association/parent->stub->self, then we process the child
# elments after the 'stub' save, which is before our own
# mapper's save.
- stub = MapperStub(self.association)
+ stub = MapperStub(self.parent, self.association, self.key)
uowcommit.register_dependency(self.parent, stub)
uowcommit.register_dependency(self.association, stub)
uowcommit.register_dependency(stub, self.mapper)
@@ -371,7 +371,8 @@ class MapperStub(object):
The Task objects in the objectstore module treat it just like
any other Mapper, but in fact it only serves as a "dependency" placeholder
for the many-to-many update task."""
- def __init__(self, mapper):
+ __metaclass__ = util.ArgSingleton
+ def __init__(self, parent, mapper, key):
self.mapper = mapper
self._inheriting_mappers = []
def register_dependencies(self, uowcommit):