tortoise / tortoise/tortoise-orm
Unaccent querys
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
Hi, I'm trying to make queries to search words witout accents.
For example, I have model with field description and in a register someone put the word Opción so in a filter i want to search that word but the user put opcion witout accentuate in letter o.
I tried:
search_word = 'option'
query = await Model.filter(Q(description__iexact=data['name']) | Q(description__icontains=data['name']))
#not works
query = await Model.filter(Q(description__search=data['name']) | Q(description__icontains=data['name']))
#not works
I have many option in filtering here https://tortoise.github.io/query.html?h=icontains#filtering, but none works for me.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the filtering documentation linked in the issue and the Model.filter/Q expressions shown in its examples. The issue names no source file or test; first determine whether accent-insensitive matching is intended and what supported database behavior should demonstrate that the work is complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100