coerce_to_bool for where(), having(), etc.
Issue #2804
resolved
so that expressions like select().where(table.c.booleancol) have a hook to evaluate into "booleancol == 1" (also what does a negation do at the moment, "NOT 1" ?). see how bad this would be for 0.9.
Comments (7)
-
reporter -
reporter - marked as critical
starting out with an approach for short circuiting as well as treatment of None in ticket_2804 branch, 1227103f0d1633a418a68b7269d7136f.
-
reporter also
#2739affected -
reporter also
#2739affected. -
reporter - changed status to resolved
-
reporter - removed milestone
Removing milestone: 0.9.0 (automated comment)
-
reporter - Fixes to the newly enhanced boolean coercion in
2804
where the new rules for "where" and "having" woudn't take effect for the "whereclause" and "having" kw arguments of the :func:.select
construct, which is also what :class:.Query
uses so wasn't working in the ORM either. fixes#3013re:#2804
→ <<cset 2e5c8913a8e1>>
- Fixes to the newly enhanced boolean coercion in
- Log in to comment
heh, see also
#2823where I'm saying that we don't want to do this, though sort of looking at it differently.true/false on a system that doesn't support t/f, it's going to be 1 or 0. If we say that any boolean type including true/false that is evaluated in any kind of context that is not a comparison just becomes "<val> == 1", that might be a solution for this and also
#2823.