summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/mapping/properties.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-13 02:39:52 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-13 02:39:52 +0000
commit4ab782cb0e1f0f0a6b4a68b67ce1aad03bee6f38 (patch)
tree8d974d9e03ffddc849ea35ac05ed54f0081f995a /lib/sqlalchemy/mapping/properties.py
parent479903bebfbccbed50d126b2c03c8dffa982b6ac (diff)
downloadsqlalchemy-4ab782cb0e1f0f0a6b4a68b67ce1aad03bee6f38.tar.gz
tweak to get_direction, rolls back a comparison of "foreigntable" to "parent"/"mapper" table to be more constrained. this change was originally in [changeset:1101] to help out the polymorph example but it now works without it. the change breaks the Post/Comment relationship in the ZBlog demo since the Post mapper has the comments table inside of it (also with no workaround).
Diffstat (limited to 'lib/sqlalchemy/mapping/properties.py')
-rw-r--r--lib/sqlalchemy/mapping/properties.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/mapping/properties.py b/lib/sqlalchemy/mapping/properties.py
index fc6762b59..34b0ae48e 100644
--- a/lib/sqlalchemy/mapping/properties.py
+++ b/lib/sqlalchemy/mapping/properties.py
@@ -228,9 +228,11 @@ class PropertyLoader(MapperProperty):
return PropertyLoader.ONETOMANY
elif self.secondaryjoin is not None:
return PropertyLoader.MANYTOMANY
- elif self.foreigntable is self.target or self.foreigntable in self.mapper.tables:
+ elif self.foreigntable == self.target:
+ #elif self.foreigntable is self.target or self.foreigntable in self.mapper.tables:
return PropertyLoader.ONETOMANY
- elif self.foreigntable is self.parent.table or self.foreigntable in self.parent.tables:
+ elif self.foreigntable == self.parent.table:
+ #elif self.foreigntable is self.parent.table or self.foreigntable in self.parent.tables:
return PropertyLoader.MANYTOONE
else:
raise ArgumentError("Cant determine relation direction")