#30841: Prevent using  __isnull lookup with non-boolean value.
-------------------------------------+-------------------------------------
     Reporter:  André Ericson        |                    Owner:  André
         Type:                       |  Ericson
  Cleanup/optimization               |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by André Ericson):

 Another interesting example related to this:

 > As an anecdote, I've also got bitten by this possibility.
 > An attempt to write WHERE (field IS NULL) = boolean_field as
 `.filter(field__isnull=F('boolean_field'))` didn't go as I expected.
 > Alexandr Aktsipetrov -- https://groups.google.com/forum/#!msg/django-
 developers/AhY2b3rxkfA/0sz3hNanCgAJ

 This example will generate the `WHERE .... IS NULL`. I guess we also would
 want an exception thrown here.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30841#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.5316990e493ddeb832bd883a1a19f8bb%40djangoproject.com.

Reply via email to