Answer the question
In order to leave comments, you need to log in
How to make case insensitive search in django db?
The title parameter comes in the url. It is necessary to make selection from a DB on this value. The following code only works with Latin characters.
def api_find_title(request, find_title=''):
found = Post.objects.values('id', 'title', 'mark', 'phone_number', 'email')\
.annotate(title_lower=Lower('title'))\
.filter(title_lower=find_title.lower())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question