diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-04-17 15:37:12 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-04-17 15:37:12 -0400 |
commit | 69dcd805d2c6ed92adf81da443c5c06d23d3423a (patch) | |
tree | 9368e15176efa0d6b5a04164ff0558c7d9ae0ae1 /lib/sqlalchemy/sql/compiler.py | |
parent | fbcfd079debf27665f23a996853903aa3b2ef23a (diff) | |
download | sqlalchemy-69dcd805d2c6ed92adf81da443c5c06d23d3423a.tar.gz |
- Added explicit true()/false() constructs to expression
lib - coercion rules will intercept "False"/"True"
into these constructs. In 0.6, the constructs were
typically converted straight to string, which was
no longer accepted in 0.7. [ticket:2117]
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index fe04da1a1..82c1748cc 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -426,9 +426,15 @@ class SQLCompiler(engine.Compiled): self.post_process_text(textclause.text)) ) - def visit_null(self, null, **kwargs): + def visit_null(self, expr, **kw): return 'NULL' + def visit_true(self, expr, **kw): + return 'true' + + def visit_false(self, expr, **kw): + return 'false' + def visit_clauselist(self, clauselist, **kwargs): sep = clauselist.operator if sep is None: |