#24479: models: please document that order_with_respect_to overwrites ordering /
add a warning
-------------------------------+--------------------
     Reporter:  blueyed        |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Uncategorized  |    Version:  master
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 (In django/db/models/options.py)

 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.26008ca6cec6020cd4397145581726d7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to