summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-12-18 16:50:49 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-12-18 16:50:49 +0000
commitb3337893365a720646e073806b9a379ad839a970 (patch)
tree18bfb4913a0ac9ab535211e0719df69864905e03 /lib/sqlalchemy/sql/expression.py
parent793339505569fe5e69ad4c9a70071406aa11a09e (diff)
downloadsqlalchemy-b3337893365a720646e073806b9a379ad839a970.tar.gz
- Query() can be passed a "composite" attribute
as a column expression and it will be expanded. Somewhat related to [ticket:1253]. - Query() is a little more robust when passed various column expressions such as strings, clauselists, text() constructs (which may mean it just raises an error more nicely). - select() can accept a ClauseList as a column in the same way as a Table or other selectable and the interior expressions will be used as column elements. [ticket:1253] - removed erroneous FooTest from test/orm/query -This line, and those below, will be ignored-- M test/orm/query.py M test/orm/mapper.py M test/sql/select.py M lib/sqlalchemy/orm/query.py M lib/sqlalchemy/sql/expression.py M CHANGES
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
-rw-r--r--lib/sqlalchemy/sql/expression.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index aa0b7228c..0f7f62e74 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -2099,6 +2099,10 @@ class ClauseList(ClauseElement):
def __len__(self):
return len(self.clauses)
+ @property
+ def _select_iterable(self):
+ return iter(self)
+
def append(self, clause):
# TODO: not sure if i like the 'group_contents' flag. need to
# define the difference between a ClauseList of ClauseLists,
@@ -2148,6 +2152,10 @@ class BooleanClauseList(ClauseList, ColumnElement):
super(BooleanClauseList, self).__init__(*clauses, **kwargs)
self.type = sqltypes.to_instance(kwargs.get('type_', sqltypes.Boolean))
+ @property
+ def _select_iterable(self):
+ return (self, )
+
class _CalculatedClause(ColumnElement):
"""Describe a calculated SQL expression that has a type, like ``CASE``.