#16112: Excluding some value in a related model excludes objects without that 
model
-------------------------------------+-------------------------------------
               Reporter:  adehnert   |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Milestone:             |      Component:  Database layer
                Version:  1.3        |  (models, ORM)
             Resolution:             |       Severity:  Normal
           Triage Stage:  Design     |       Keywords:
  decision needed                    |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Design decision needed


Comment:

 The docs basically say that the ORM won't crash'n'burn when you're
 filtering on `foo__bar=42` just because one of your objects doesn't have a
 related `Foo` object. See the paragraph that follows your quote. It
 doesn't really say anything about "negative queries".

 That said, I agree with your analysis. Assuming a given object doesn't
 have an associated `Foo` object, the value of its `foo__bar` is something
 akin to `NaN`. Since `NaN != <whatever>` evaluates to `True`, this analogy
 supports your interpretation.

 Fixing this problem would be backwards incompatible: it would change the
 result of "negative queries". IMO, we can't say it's an obvious bug,
 rather an under-defined behavior. So I'll mark it as DDN.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16112#comment:1>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to