summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/mapping/mapper.py10
-rw-r--r--lib/sqlalchemy/mapping/objectstore.py1
-rw-r--r--lib/sqlalchemy/sql.py1
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/sqlalchemy/mapping/mapper.py b/lib/sqlalchemy/mapping/mapper.py
index 7b4595fb0..330c75c31 100644
--- a/lib/sqlalchemy/mapping/mapper.py
+++ b/lib/sqlalchemy/mapping/mapper.py
@@ -67,9 +67,11 @@ class Mapper(object):
self.table = sql.join(inherits.table, table, inherit_condition)
self._synchronizer = sync.ClauseSynchronizer(self, self, sync.ONETOMANY)
self._synchronizer.compile(self.table.onclause, inherits.tables, TableFinder(table))
+ self.inherits = inherits
else:
self.primarytable = self.table
self._synchronizer = None
+ self.inherits = None
# locate all tables contained within the "table" passed in, which
# may be a join or other construct
@@ -670,13 +672,15 @@ class Mapper(object):
except KeyError:
return False
- def register_dependencies(self, *args, **kwargs):
+ def register_dependencies(self, uowcommit, *args, **kwargs):
"""called by an instance of objectstore.UOWTransaction to register
which mappers are dependent on which, as well as DependencyProcessor
objects which will process lists of objects in between saves and deletes."""
for prop in self.props.values():
- prop.register_dependencies(*args, **kwargs)
-
+ prop.register_dependencies(uowcommit, *args, **kwargs)
+ if self.inherits is not None:
+ uowcommit.register_dependency(self.inherits, self)
+
def register_deleted(self, obj, uow):
for prop in self.props.values():
prop.register_deleted(obj, uow)
diff --git a/lib/sqlalchemy/mapping/objectstore.py b/lib/sqlalchemy/mapping/objectstore.py
index d0e1573c6..d2aca8b06 100644
--- a/lib/sqlalchemy/mapping/objectstore.py
+++ b/lib/sqlalchemy/mapping/objectstore.py
@@ -534,7 +534,6 @@ class UOWTransaction(object):
def register_dependency(self, mapper, dependency):
"""called by mapper.PropertyLoader to register the objects handled by
one mapper being dependent on the objects handled by another."""
-
# correct for primary mapper (the mapper offcially associated with the class)
self.dependencies[(mapper._primary_mapper(), dependency._primary_mapper())] = True
self.__modified = True
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py
index a6ddf8cb9..d4312a151 100644
--- a/lib/sqlalchemy/sql.py
+++ b/lib/sqlalchemy/sql.py
@@ -1211,7 +1211,6 @@ class Select(SelectBaseMixin, FromClause):
self.visit_select(cs)
for s in cs.selects:
s.parens = False
- print "BUT", id(cs), cs.parens
def visit_column(self, c):pass
def visit_table(self, c):pass
def visit_select(self, select):