#24753: Reverse FK conditions filter queryset when used in case statements in
some
cases
----------------------------------------------+--------------------
Reporter: mdentremont | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
I'm running into some odd behaviour with the new conditional support added
in 1.8.
My use case is the following:
- Annotate a queryset with the count of reverse FKs, matching a condition
This works fine given a many-to-one relationship, however not with many-
to-one/none.
With the many-to-one/none, it appears an INNER JOIN is made, which removes
objects from my queryset which an empty reverse FK set.
To summarize:
Expected:
Annotate all objects with the a count of reverse FKs matching a condition
Actual:
Annotate only objects objects with 1 or more associated reverse FKs, with
a count of the reverse FKs matching a condition
--
Ticket URL: <https://code.djangoproject.com/ticket/24753>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/054.12d828b9a1ae8959a4c91a2f88b0d2db%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.