#17252: Multi-sort in admin does not respect initial admin_order_field
-------------------------------------+-------------------------------------
Reporter: sebastian | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: SVN
Severity: Normal | Resolution:
Keywords: multi-sort, admin, | Triage Stage: Accepted
ordering | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 1
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Comment (by sebastian):
Sure, making `ordering` more explicit would be nice but IMHO that's
outside the scope of this ticket. Here, I'm only concerned with the
regression introduced by the multi-sort addition to the admin which causes
the initial sort indicator icons to not show up under certain
circumstances, i.e. whenever something is sorted with `admin_order_field`.
This bug is not a functional issue per se, but hiding those icons when the
admin change list is actually sorted (which it is) is kind of misleading
to the user.
Regarding the proposition of making `ordering` more explicit, I suggest
opening a new ticket for that and keeping this one for the regression at
hand. Some questions arise, however, how far this more explicit `ordering`
should reach: should method names also be allowed in models, ie. not only
model admins? So would this be allowed:
{{{#!python
class MyModel(Model):
foo = models.CharField()
def bar(self):
return self.foo
bar.admin_order_field = 'foo'
class Meta:
ordering = ('bar',) # <-- Should we be able to order by methods
in the model, too?
# If not, the currently analogous
behavior of (Model|ModelAdmin).ordering is lost.
}}}
You see, I think this needs some more thought which cannot (or rather
should not, IMHO) be covered in this purely regression-related ticket.
What do you suggest?
--
Ticket URL: <https://code.djangoproject.com/ticket/17252#comment:5>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.