Friday, October 31, 2014

Re: Charfield case insensitive sorting in Model Admin

Hi Collin,

Thanks for the solution !


On Thursday, 30 October 2014 02:39:53 UTC+8, Collin Anderson wrote:
Hello,

One way to do it would be to have add an editable=False field name_sort that's a lower() version of your name field. You can update that field in the save method.

In the admin, you can tell it to order by name_sort using admin_order_field.

Collin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e6e30209-44a1-4655-ab28-2f74017baac8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment