1. When `order_with_respect_to` is being used, and value in `ordering`
gets silently overwritten:
self.ordering = ('_order',)
This should be documented.
2. Additionally, I am wondering if there should be a warning / hint when
this happens, i.e. when `self.ordering` is non-empty. It might be
possible to keep any existing values, and prepend/append the `_order`
value?!
3. With that code (`models.Options._prepare`), `ordering` gets set to
`('_order',)` always (see point 1), but the proxy "field" gets only added
if there's no `OrderWrt` field yet. This could lead to having an invalid
setting for `ordering`, in case there's a `OrderWrt` field that's not
named `_order`?!
I think point 1 should be addressed anyway (apart from what gets done
considering 2. and 3.).
--
Ticket URL: <https://code.djangoproject.com/ticket/24479>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* component: Uncategorized => Core (System checks)
* needs_tests: => 0
* needs_docs: => 0
* type: Bug => New feature
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/24479#comment:1>
* owner: nobody => coldmind
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/24479#comment:2>
* cc: jon.dufresne@… (added)
* has_patch: 0 => 1
Comment:
https://github.com/django/django/pull/4343
--
Ticket URL: <https://code.djangoproject.com/ticket/24479#comment:3>
* owner: coldmind =>
* status: assigned => new
Comment:
@jdufresne, if you decided to work on ticket, you must mark it is as
assigned to yourself, so people will see that someone is working on it
now. I spent some time on it today, and, likely, in vain.
--
Ticket URL: <https://code.djangoproject.com/ticket/24479#comment:4>
Comment (by jdufresne):
Sorry about that. I meant no disrespect. I will do so next time.
--
Ticket URL: <https://code.djangoproject.com/ticket/24479#comment:5>
* cc: me@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/24479#comment:6>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24479#comment:7>
* needs_better_patch: 1 => 0
Comment:
Updated patch based on feedback from reviews. Added additional tests and
docs. All tests are passing.
--
Ticket URL: <https://code.djangoproject.com/ticket/24479#comment:8>
* status: new => closed
* owner: => Tim Graham <timograham@…>
* resolution: => fixed
Comment:
In [changeset:"966a29c2b83fed2fc7c2b5b09de80cbebc94ac74" 966a29c]:
{{{
#!CommitTicketReference repository=""
revision="966a29c2b83fed2fc7c2b5b09de80cbebc94ac74"
Fixed #24479 -- Added system check to prevent both ordering and order_wrt.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24479#comment:9>