diff options
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
-rw-r--r-- | lib/sqlalchemy/sql/expression.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 631a1b205..46873c859 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -29,7 +29,7 @@ to stay the same in future releases. import itertools, re from operator import attrgetter -from .. import util, exc +from .. import util, exc, inspection from . import operators from .operators import ColumnOperators from .visitors import Visitable, cloned_traverse @@ -1525,6 +1525,7 @@ class ClauseElement(Visitable): _from_objects = [] bind = None _is_clone_of = None + is_selectable = False def _clone(self): """Create a shallow copy of this ClauseElement. @@ -1841,6 +1842,8 @@ class ClauseElement(Visitable): return '<%s.%s at 0x%x; %s>' % ( self.__module__, self.__class__.__name__, id(self), friendly) +inspection._self_inspects(ClauseElement) + class _Immutable(object): """mark a ClauseElement as 'immutable' when expressions are cloned.""" @@ -2394,6 +2397,12 @@ class Selectable(ClauseElement): """mark a class as being selectable""" __visit_name__ = 'selectable' + is_selectable = True + + @property + def selectable(self): + return self + class FromClause(Selectable): """Represent an element that can be used within the ``FROM`` clause of a ``SELECT`` statement. |