If you're using PosgreSQL, django.contrib.postgres provides such a function.

-- 
Aymeric.

> Le 6 mai 2015 à 02:52, Paulo Maciel <[email protected]> a écrit :
> 
> I am returning the query Something.objects.all().order_by(Lower('name'))  but 
> the order is not respecting names that start with accent, causing these 
> results appear at the end of ordering. We need a function to ignore accents 
> and order correctly names with accents, as well as function Lower treats the 
> results.
> 
> Currently:
> 
> arroz
> baleia
> dado
> limão
> xerox
> água
> ótimo
> 
> As it should be:
> 
> água
> arroz
> baleia
> dado
> limão
> ótimo
> xerox
> 
> 
> We need a function like it to fix the problem:
> Person.objects.all().order_by(Unaccent('name'))
> 
> This is a priority issue because it affects thousands of Brazilians and other 
> nationalities who use Portuguese.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/27620089-a89e-4e13-9576-637e37395754%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/F4794B20-EA76-4A41-A4CD-8D2DA473E82F%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to