how to have Accent-insensitive filter in django with postgres?

前端 未结 5 1769
挽巷
挽巷 2021-02-04 12:32

Hi I find that on postgres database, we can\'t configure default accent sensivity (on old mail exchanges).

Is there a way to have a _icontains also insensitive to specia

5条回答
  •  抹茶落季
    2021-02-04 12:58

    I just released (a few days ago) the django-unaccent library that add operators to the django ORM for unaccent search. It monkeypatch the django ORM and uses the unaccent() function of postgres to do so.

    Please, check this out => https://github.com/djcoin/django-unaccent

提交回复
热议问题