#34728: OR operator on queryset does not work as expected
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
Inglorious-Inge |
Type: Bug | Status: new
Component: Database | Version: 4.2
layer (models, ORM) |
Severity: Normal | Keywords: queryset OR
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I try to combine two querysets using the {{{|}}} operator. Even though one
of the querysets isn't empty, the resulting queryset is empty.
Example:
{{{similar_recipes = at_least_four_shared_ingredients |
same_tag_and_at_least_two_shared_ingredients}}}
{{{same_tag_and_at_least_two_shared_ingredients}}} contains entries but
{{{similar_recipes}}} doesn't.
You can reproduce the problem here: https://github.com/Inglorious-
Inge/Kochbuch2/tree/queryset_problem
The test in {{{recipes/tests/test_models.py}}} is failing.
The code under test is in {{{recipes/models.py}}} line 30-45.
--
Ticket URL: <https://code.djangoproject.com/ticket/34728>
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/0107018974cb24b0-02faaf12-8b7a-468e-a7ce-7da6d0203400-000000%40eu-central-1.amazonses.com.