Opened 13 years ago
Closed 8 years ago
#13793 closed Bug (fixed)
reverse of OneToOne relation should use default manager if use_for_related_fields specified
Reported by: | Shaun Cutts | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.2 |
Severity: | Normal | Keywords: | use_for_related_fields |
Cc: | shaun@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When retrieving the related object in a reverse OneToOne relation, the SingleRelatedObjectDescriptor doesn't respect "use_for_related_fields" if defined by the default manager for the class of the related object. See patch for proposed fix (which indicates the code in question as well).
Attachments (1)
Change History (9)
Changed 13 years ago by
Attachment: | one_to_one_use_default_manager_if_asked.diff added |
---|
comment:1 Changed 13 years ago by
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 Changed 13 years ago by
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:3 Changed 13 years ago by
Needs tests: | set |
---|
comment:6 Changed 8 years ago by
Keywords: | use_for_related_fields added |
---|
comment:7 Changed 8 years ago by
PR6175 deprecates use_for_related_fields
. "to-one" relations go through _base_manager
which can be specified with the base_manager_name
model option.
Note: See
TracTickets for help on using
tickets.
patch for SingleRelatedObjectDescriptor