coerce_to_bool for where(), having(), etc.

Issue #2804 resolved
Mike Bayer repo owner created an issue

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)

  1. Mike Bayer reporter

    heh, see also #2823 where 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.

  2. Mike Bayer 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 #3013 re: #2804

    → <<cset 2e5c8913a8e1>>

  3. Log in to comment