Accent insensitive search django sqlite -


i using sqlite , django. trying search accented strings stored in sqlite database using non-accented search query.

for example: search "rio grande" when database contains "río grande".

i found post sqlite accent-insensitive search mentions first create collation , call search query using collate noaccents

this need. not sure how using django models. suggestions?

as suggested in postgres specific post on django documentation: postgresql specific lookups tried following:

myobject.objects.filter(locationtuple__unaccent__contains='rio grande') 

but got following error: fielderror: unsupported lookup 'unaccent' charfield or join on field not permitted. understandable because lookup might not work sqlite.

i think closest thing you're going find, however, needs development work:

https://github.com/djcoin/django-unaccent

i'm jealous well, workplace isn't on postgresql either (yet).


Comments