#19222: Clarify that custom managers don't apply to intermediate joins
--------------------------------------+------------------------------------
Reporter: andrewbadr | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by loic):
* keywords: use_for_related_fields =>
* version: 1.4 => master
Old description:
> I have a custom Manager to filter out model instances with where the
> field `deleted` is `True`. I'm using an ORM query that looks like
> `user1.page_set.filter(membership__user=user2)`. The option
> `use_for_related_fields=True` is set on the relevant manager.
>
> My expectation is that `Membership` objects with the deleted flag set are
> not included in the query. Instead, they are being included.
>
> The documentation for `use_for_related_fields` should should specify that
> it doesn't work in this case.
New description:
I have a custom Manager to filter out model instances with where the field
`deleted` is `True`. I'm using an ORM query that looks like
`user1.page_set.filter(membership__user=user2)`.
My expectation is that `Membership` objects with the deleted flag set are
not included in the query. Instead, they are being included.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/19222#comment:6>
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/068.23ceb873af6c7bd5c6d6b7223a3cf9e4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.