diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-09-09 16:03:23 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-09-09 16:03:23 -0400 |
commit | 840aab3beacdd1fe2a000dcd761d0514035cff94 (patch) | |
tree | f50542c02df4aef4573fac611c536f48ba47af39 /lib/sqlalchemy/sql/expression.py | |
parent | 1492cc634ee67afb5ad03f0d56caca9fc3bbcc0e (diff) | |
download | sqlalchemy-840aab3beacdd1fe2a000dcd761d0514035cff94.tar.gz |
- Behavioral improvement: empty
conjunctions such as and_() and or_() will be
flattened in the context of an enclosing conjunction,
i.e. and_(x, or_()) will produce 'X' and not 'X AND
()'. [ticket:2257].
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
-rw-r--r-- | lib/sqlalchemy/sql/expression.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 082313724..9e920c34f 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -2902,6 +2902,12 @@ class BooleanClauseList(ClauseList, ColumnElement): def _select_iterable(self): return (self, ) + def self_group(self, against=None): + if not self.clauses: + return self + else: + return super(BooleanClauseList, self).self_group(against=against) + class _Tuple(ClauseList, ColumnElement): def __init__(self, *clauses, **kw): |