diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-01-24 23:37:03 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-01-24 23:37:03 +0000 |
commit | 9349ef38efad07157c163afa387820c870ce97e9 (patch) | |
tree | c454b9d418573641524127326d8592d849521cd8 /lib/sqlalchemy/sql_util.py | |
parent | 142d3f4bfd1296c045eda3e711c424a52825dab0 (diff) | |
download | sqlalchemy-9349ef38efad07157c163afa387820c870ce97e9.tar.gz |
- calling corresponding_column with keys_ok matches columns on name, not key, since
the name is meaningful with regards to SQL relationships, the key is not
- adjustments to the recent polymorphic relationship refactorings, specifically
for many-to-one relationships to polymorphic unions that did not contain the
base table [ticket:439]. the lazy/eager clause adaption to the selectable
will match up on straight column names (i.e. its a more liberal policy)
- lazy loader will not attempt to adapt the clause to the selectable if
loads_polymorphic is not enabled, since the more liberal policy of adapting
columns fails for more elaborate join conditions
- will have to see if ppl want to do complex joins with polymorphic relations...
may have to add "polymorphic_primaryjoin" in that case as a last resort (would make
working around these issues a snap, tho...)
Diffstat (limited to 'lib/sqlalchemy/sql_util.py')
-rw-r--r-- | lib/sqlalchemy/sql_util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql_util.py b/lib/sqlalchemy/sql_util.py index 4c6cd4d07..6b87a2dec 100644 --- a/lib/sqlalchemy/sql_util.py +++ b/lib/sqlalchemy/sql_util.py @@ -139,11 +139,11 @@ class ClauseAdapter(sql.ClauseVisitor): self.selectable = selectable def visit_binary(self, binary): if isinstance(binary.left, sql.ColumnElement): - col = self.selectable.corresponding_column(binary.left, raiseerr=False, keys_ok=False) + col = self.selectable.corresponding_column(binary.left, raiseerr=False, keys_ok=True) if col is not None: binary.left = col if isinstance(binary.right, sql.ColumnElement): - col = self.selectable.corresponding_column(binary.right, raiseerr=False, keys_ok=False) + col = self.selectable.corresponding_column(binary.right, raiseerr=False, keys_ok=True) if col is not None: binary.right = col |