#34728: OR operator on queryset does not work as expected
-------------------------------------+-------------------------------------
     Reporter:  Kbleser              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  queryset OR          |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by René Fleschenberg):

 * status:  closed => new
 * resolution:  invalid =>


Comment:

 Natalia, I disagree. It is not a support request (the reporters problem
 was solved by using a different API), but a possible bug in the ORM.
 Combining two querysets with {{{|}}} where at least one of them is non-
 empty should not result in an empty queryset, IMO. If it can (when?), we
 should probably document this.

 It also seems to me that the behaviour does not match the note in the
 [https://docs.djangoproject.com/en/4.2/ref/models/querysets/#or docs]
 about equivalency with {{{Q}}} objects?

 If we can't agree here on whether this is a bug or not, should we start an
 ML discussion?

 BTW, on Discord, there has been another report about {{{qs1 | qs2}}} and
 {{{qs2 | qs1}}} not being equivalent, which they should be according to
 the docs. This is probably outside of the scope of this ticket, but I
 thought it's worth mentioning here (maybe we can fix both issues in one
 go).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34728#comment:4>
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/01070189778b0962-25d15038-aabb-4784-b1bc-099fe6bacd57-000000%40eu-central-1.amazonses.com.

Reply via email to