Opened 9 years ago
Closed 8 years ago
#25201 closed New feature (fixed)
Allow use_for_related_fields via as_manager()
Reported by: | Simon Litchfield | Owned by: | Anderson Resende |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.8 |
Severity: | Normal | Keywords: | use_for_related_fields |
Cc: | Loic Bistuer | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The as_manager() method allows easy creation of chain-able managers. One of the most common use cases for these is with related fields. However, as_manager() doesn't currently allow use_for_related_fields to be specified. This patch proposes it could be set simply by way of an attribute on the QuerySet class, in the same way it currently does for Manager classes.
Change History (8)
comment:1 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 9 years ago
Easy pickings: | unset |
---|---|
Has patch: | unset |
comment:3 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
I think the general idea is accepted even if the exact API needs to be worked out.
comment:4 by , 9 years ago
Cc: | added |
---|
Loic, can we close this in light of your PR to refactor manager inheritance (and deprecate use_for_related_fields
)?
comment:5 by , 9 years ago
Indeed, but maybe we should let the commit messages close this ticket? Not counting the chickens before they're hatched kinda thing?
comment:6 by , 8 years ago
Keywords: | use_for_related_fields added |
---|
ticket:24863#comment:10 might solve this. By the way, if you mean to propose a patch, I don't see it.