I had a model with a foreign key to User and I needed to filter by user's
email address:
list_filter = [
'user__email',
]
The list came out in a random order.
As a workaround I changed line 20 in filterspecs.py:
for val in values:
to:
for val in sorted(values, key=lambda(x): str.lower(x[1])):
This is fine for my use but will override any existing order_by in the
underlying models. A better solution would be to either allow this to be
turned on or off or even better - allow the user to specify the key to sort by.
Original issue reported on code.google.com by andybak on 27 Jan 2010 at 9:41
Original issue reported on code.google.com by
andybak
on 27 Jan 2010 at 9:41