summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r--lib/sqlalchemy/sql.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py
index 45a95795f..34f59fd9c 100644
--- a/lib/sqlalchemy/sql.py
+++ b/lib/sqlalchemy/sql.py
@@ -1033,6 +1033,12 @@ class ColumnClause(ColumnElement):
_label = property(_get_label)
def accept_visitor(self, visitor):
visitor.visit_column(self)
+ def to_selectable(self, selectable):
+ """given a Selectable, returns this column's equivalent in that Selectable, if any.
+
+ for example, this could translate the column "name" from a Table object
+ to an Alias of a Select off of that Table object."""
+ return selectable._get_col_by_original(self.original, False)
def _get_from_objects(self):
if self.table is not None:
return [self.table]