#34728: OR operator on queryset does not work as expected
-------------------------------------+-------------------------------------
Reporter: Kbleser | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution: needsinfo
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 Natalia Bidart):
* cc: Simon Charette (added)
Comment:
Replying to [comment:11 René Fleschenberg]:
> I suspect you looked at the {{{main}}} branch, which doesn't show the
problem :) Sorry, I should have explicitly mentioned the branch here. If
you checkout the branch {{{queryset_problem}}} and run the tests, you
should see that the test in {{{recipes/tests/test_models.py}}} is failing:
https://github.com/Inglorious-
Inge/Kochbuch2/blob/queryset_problem/recipes/tests/test_models.py
Excellent! I was able to reproduce the failure as reported. What I also
noticed is that without the annotation, the OR behaves as expected (though
I understand the goal of the annotation in this case).
I've been trying to debug further by re-writting the queries in
`find_similar_recipes`, and then checking results and the generated SQL. I
can't detect anything obviously wrong so my next step would be to craft
the SQL I would use if I'd be building this by hand, but I ran out of time
today.
I'll CC Simon in this ticket, I believe they may have a clearer view of
what's expected/supported and what's not. Personally, I do find the
outcome a bit unexpected, so I share the feeling, but the experts will
know more.
--
Ticket URL: <https://code.djangoproject.com/ticket/34728#comment:13>
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/0107018993c15f86-d412d7c0-3070-43df-8258-24cfe638f2d8-000000%40eu-central-1.amazonses.com.