diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-03-02 21:22:14 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-03-02 21:22:14 +0000 |
commit | 2a77850707db1dc71bd069be04b049cc52af8983 (patch) | |
tree | da3aebcd2d59de3c025b785f2c703b513255953f /lib/sqlalchemy/sql_util.py | |
parent | 7e2ae824a56c760286e33adce03324b8e696472a (diff) | |
download | sqlalchemy-2a77850707db1dc71bd069be04b049cc52af8983.tar.gz |
- added "fold_equivalents" argument to Join.select(), which removes
'duplicate' columns from the resulting column clause that are known to be
equivalent based on the join condition. this is of great usage when
constructing subqueries of joins which Postgres complains about if
duplicate column names are present.
- added support to polymorphic stuff for more than one "equivalent column",
when trying to target columns in the polymorphic union; this applies
to multi-leveled inheritance
- put above-two concepts together to get the abc_inheritance tests to work
with postgres
Diffstat (limited to 'lib/sqlalchemy/sql_util.py')
-rw-r--r-- | lib/sqlalchemy/sql_util.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql_util.py b/lib/sqlalchemy/sql_util.py index db3590cd8..3eb4b6d06 100644 --- a/lib/sqlalchemy/sql_util.py +++ b/lib/sqlalchemy/sql_util.py @@ -221,5 +221,8 @@ class ClauseAdapter(AbstractClauseProcessor): return None newcol = self.selectable.corresponding_column(col, raiseerr=False, keys_ok=False) if newcol is None and self.equivalents is not None and col in self.equivalents: - newcol = self.selectable.corresponding_column(self.equivalents[col], raiseerr=False, keys_ok=False) + for equiv in self.equivalents[col]: + newcol = self.selectable.corresponding_column(equiv, raiseerr=False, keys_ok=False) + if newcol: + return newcol return newcol |