diff options
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r-- | lib/sqlalchemy/sql.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 559847261..5f392a61c 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -694,7 +694,12 @@ class ColumnCollection(util.OrderedProperties): if c.shares_lineage(local): l.append(c==local) return and_(*l) - + def contains_column(self, col): + # have to use a Set here, because it will compare the identity + # of the column, not just using "==" for comparison which will always return a + # "True" value (i.e. a BinaryClause...) + return col in util.Set(self) + class FromClause(Selectable): """represents an element that can be used within the FROM clause of a SELECT statement.""" def __init__(self, name=None): @@ -1400,6 +1405,7 @@ class CompoundSelect(_SelectBaseMixin, FromClause): for c in s.c: yield c def _proxy_column(self, column): + print "PROXYING COLUMN", type(column), column if self.use_labels: col = column._make_proxy(self, name=column._label) else: |