You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hi,
I am using Django 1.7 on Python 3.4 and quite new to both Django and Python.
I would like to sort a name field (Charfield) in ModelAdmin view in case-insensitive way. The default sorting is case-sensitive.
How could I sort it in case-insensitive?
Thanks in advance.
Collin Anderson
unread,
Oct 29, 2014, 2:39:53 PM10/29/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
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
Azam Alias
unread,
Oct 31, 2014, 8:38:01 PM10/31/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message