Opened 13 years ago
Last modified 11 years ago
#18098 new Bug
order_with_respect_to should construct set_RELATED_order() method name from related_name
Reported by: | Daniel Swarbrick | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
If two identically named models in separate apps refer to a parent to the same parent model in their order_with_respect_to, only one set_RELATED_order() method is created on the parent model.
Attachments (1)
Change History (6)
by , 13 years ago
Attachment: | order_wrt.diff added |
---|
comment:1 by , 13 years ago
comment:2 by , 12 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
The problem is valid. However the proposed solution doesn't guarantee backwards compatibility. I'm not sure of what we should do.
comment:3 by , 12 years ago
How about making the order_with_respect_to attribute either a model name string for backwards compatibility, or a two-tuple, containing the parent model, and a name to assign the relationship? It's perhaps not the most elegant, but would satisfy both requirements.
comment:4 by , 12 years ago
Triage Stage: | Design decision needed → Accepted |
---|
We're getting rid of the DDN state, and this is a valid problem.
comment:5 by , 11 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
This following situation would cause this problem to surface:
"Device" objects would only have the one
set_expansionmodule_order()
method.