#17522: ModelAdmin.ordering validation too strict
-------------------------------------+-------------------------------------
     Reporter:  Sebastian Goll       |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  admin, validation,   |             Triage Stage:  Accepted
  ordering, strict                   |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Kevin Christopher Henry):

 > If you are dynamically defining an annotation then why are you not
 dynamically ordering by this annotation and expecting static options to
 work with it?

 I'm expecting it because that's how `list_display` works. The purpose of
 `admin_order_field` is to allow you to ''statically declare'' how to order
 a ''dynamic'' piece of code. Given that this exists, it seems wrong not to
 respect it when it comes to the `ordering` attribute.

 To me, the bug isn't about how much you can or can't declare statically,
 it's about making the API more consistent. I haven't looked at the
 proposed patch, but I think this general idea - considering
 `admin_order_field` when looking at `ordering` - will be an improvement.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17522#comment:8>
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/067.dffcc7598f44ee60391472691a31de30%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to