SearchFilter with unaccent #7759
Unanswered
gdvalderrama
asked this question in
Ideas & Suggestions
Replies: 1 comment 6 replies
-
That's an interesting idea yup. Questions:
I suppose a suggestion here might be to use the existing functionality, and tweak the lookup prefixes?... Eg. either this... class UnaccentedSearchFilter(SearchFilter):
lookup_prefixes = {
'^': 'istartswith',
'=': 'unaccent',
'@': 'search',
'$': 'iregex',
} Or this... class UnaccentedSearchFilter(SearchFilter):
lookup_prefixes = {
'^': 'istartswith',
'=': 'iexact',
'~': 'unaccent',
'@': 'search',
'$': 'iregex',
} Which perhaps resolves the use-case without requiring any code changes in the framework? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently SearchFilter offers 4 restrictions:
It would be great to have the possibility of using
__unaccent
lookup.Example:
Search for "Héctor" would also return "Hector".
Beta Was this translation helpful? Give feedback.
All reactions