I need to make a query that return results ignoring case and accents. Example: I search for 'atacadao' and as a possible answer would be Atacadão, atacadão, Atacadao and atacadao.
Asked
Active
Viewed 320 times
0
-
1you can use `__icontains=` to ignoring case – Max Apr 29 '21 at 01:54
-
You need to use some collation which is case insensitive and accent insensitive. The name of the collation you can use depends on the database you are using. – Abdul Aziz Barkat Apr 29 '21 at 05:13
1 Answers
0
I don't believe native python will do this. You will need to use a library to decode the text first, and then search against the database.
A popular one is Unidecode which is explained in this article:
What is the best way to remove accents (normalize) in a Python unicode string?

OneAdamTwelve
- 236
- 1
- 3
- 14