M
M
Mikhail Bolev2021-03-24 20:51:41
Django
Mikhail Bolev, 2021-03-24 20:51:41

How to search for Russian text in django?

There is a need to organize a search for Russian words. From the documentation for django, it is clear that when using the SQLite database, the search is case-sensitive. How it is possible to bypass it? Here is an example of using search:

class ProductListView(ListView):
    model = Product  

    def get_queryset(self):
        qs = super().get_queryset()
        get_params = self.request.GET.dict()

        # search
        if get_params.get('q'):
            qs = qs.filter(product_title__icontains=get_params.get('q'))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-03-24
@Scorpion_MB

Problem with search, case and cyrillic in Django REST Framework?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question