summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/mapping/properties.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-17 21:11:59 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-17 21:11:59 +0000
commit0e599da0cfd64c0921ba31bb8957aa5d409318c0 (patch)
tree0536e029b8d1427266848ade572a1ae9845b5bd6 /lib/sqlalchemy/mapping/properties.py
parenta1e12ea16f79d8b72420138e8ab53fcf61993698 (diff)
downloadsqlalchemy-0e599da0cfd64c0921ba31bb8957aa5d409318c0.tar.gz
identified more issues with inheritance. mapper inheritance is more closed-minded about how it creates the join crit
erion as well as the sync rules in inheritance. syncrules have been tightened up to be smarter about creating a new SyncRule given lists of tables and a join clause. properties also checks for relation direction against the "noninherited table" which for the moment makes it a stronger requirement that a relation to a mapper must relate to that mapper's main table, not any tables that it inherits from.
Diffstat (limited to 'lib/sqlalchemy/mapping/properties.py')
-rw-r--r--lib/sqlalchemy/mapping/properties.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sqlalchemy/mapping/properties.py b/lib/sqlalchemy/mapping/properties.py
index 34b0ae48e..e5f702b57 100644
--- a/lib/sqlalchemy/mapping/properties.py
+++ b/lib/sqlalchemy/mapping/properties.py
@@ -228,11 +228,9 @@ class PropertyLoader(MapperProperty):
return PropertyLoader.ONETOMANY
elif self.secondaryjoin is not None:
return PropertyLoader.MANYTOMANY
- elif self.foreigntable == self.target:
- #elif self.foreigntable is self.target or self.foreigntable in self.mapper.tables:
+ elif self.foreigntable == self.mapper.noninherited_table:
return PropertyLoader.ONETOMANY
- elif self.foreigntable == self.parent.table:
- #elif self.foreigntable is self.parent.table or self.foreigntable in self.parent.tables:
+ elif self.foreigntable == self.parent.noninherited_table:
return PropertyLoader.MANYTOONE
else:
raise ArgumentError("Cant determine relation direction")
@@ -529,6 +527,7 @@ class PropertyLoader(MapperProperty):
The list of rules is used within commits by the _synchronize() method when dependent
objects are processed."""
+
parent_tables = util.HashSet(self.parent.tables + [self.parent.primarytable])
target_tables = util.HashSet(self.mapper.tables + [self.mapper.primarytable])