Opened 5 years ago
Closed 5 years ago
#31342 closed Cleanup/optimization (fixed)
Default manager vs Base manager for RelatedManager
Reported by: | Benjamin Mampaey | Owned by: | Carlton Gibson |
---|---|---|---|
Component: | Documentation | Version: | 3.0 |
Severity: | Normal | Keywords: | manager |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The documentation on Base Managers https://docs.djangoproject.com/en/2.2/topics/db/managers/#base-managers is confusing or incomplete.
It specifies "By default, Django uses an instance of the Model._base_manager manager class when accessing related objects (i.e. choice.question), not the _default_manager on the related object."
But when accessing the set of related objects, i.e. question.choice_set, it is the default manager that is used. This does not appear clearly in the documentation.
Change History (4)
comment:1 by , 5 years ago
Easy pickings: | unset |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
Version: | 2.2 → 3.0 |
comment:3 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Hi Benjamin.
This comes up every so often — it's hard stuff.
The docs have:
But I think the required information is really in the Making Queries topic page. I've suggested a PR adding a link back to the Following relationships backward section there. Hopefully that's clearer.
Thanks for the report.