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
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.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To add tests to the patch, then uncheck the "Needs tests" flag on the ticket.
- To improve the patch as described in the pull request review comments or on this ticket, then uncheck "Patch needs improvement".
If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (6)
by , 13 years ago
Attachment: | order_wrt.diff added |
---|
comment:1 by , 13 years ago
comment:2 by , 13 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 , 13 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.