You'll need to write a custom filter which sorts by lower case. It's pretty simple:
@register.filter
def sort_lower(lst, key_name):
return sorted(lst, key=lambda item: getattr(item, key_name).lower())
But if your list is a set of objects from the database, you shouldn't really be sorting them in Python - you should get the database to return them in the order you want.
Edit
How are you using the filter? It should be exactly the same as the dictsort one: object_list|sort_lower:"name"
.
To sort the queryset in the database, you can use the extra
method to add a lower-case version of the field:
MyModel.objects.all().extra(select={'lower_name': 'LOWER(NAME)'}, order_by='lower_name')