Opened 13 months ago
Closed 13 months ago
#34915 closed New feature (wontfix)
Do not autopopulate _order field for model with an order_with_respect_to if already set.
Reported by: | Tilman Koschnick | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If a model has the Meta option "order_with_respect_to", new instances of the model have the _order field autopopulated, no matter if the _order field is already set or not. I propose to only set the field if it has not previously been set already, allowing a custom order to be set before saving new objects, and saving a query to the database in this case.
This will not affect existing code that does not explicitly set the _order field before saving the object.
Attachments (1)
Change History (2)
by , 13 months ago
comment:1 by , 13 months ago
Has patch: | unset |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Summary: | do not autopopulate _order field for model with an order_with_respect_to if already set → Do not autopopulate _order field for model with an order_with_respect_to if already set. |
Type: | Uncategorized → New feature |
Note:
See TracTickets
for help on using tickets.
Thanks for this ticket, however, I don't understand why you want to set ordering with respect to the given field and in the same time set it manually. It seems that you should use your own custom logic for ordering and disable
order_with_respect_to
. The proposed behavior would be confusing and counterintuitive.You can start a discussion on DevelopersMailingList if you don't agree, where you'll reach a wider audience and see what other think.