diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-03 09:59:22 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-03 09:59:22 -0400 |
commit | 1378bf0d25319f3725cfe8ff947a5f0aeae4cc81 (patch) | |
tree | ded7439311a70858ef11e4b8689fae478f0e7196 /lib/sqlalchemy/sql/expression.py | |
parent | 47a799ecd5d03b78e5d67918302c0da2950d27b8 (diff) | |
download | sqlalchemy-1378bf0d25319f3725cfe8ff947a5f0aeae4cc81.tar.gz |
- reopened #2453, needed to put in the original patch as well to cover the case
of column_property() objs building off each other
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
-rw-r--r-- | lib/sqlalchemy/sql/expression.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index f37faa801..f9a3863da 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -4802,6 +4802,15 @@ class Select(_SelectBase): toremove = set(itertools.chain(*[f._hide_froms for f in froms])) if toremove: + # if we're maintaining clones of froms, + # add the copies out to the toremove list + if self._from_cloned: + toremove.update( + self._from_cloned[f] for f in + toremove.intersection(self._from_cloned) + ) + # filter out to FROM clauses not in the list, + # using a list to maintain ordering froms = [f for f in froms if f not in toremove] if len(froms) > 1 or self._correlate: |