V
V
Vinand2017-05-03 22:34:47
Django
Vinand, 2017-05-03 22:34:47

Why Django view ajax function doesn't want to work with cyrillic text (live search)?

@api_view(['POST', ])
def live_search(request):
        if request.method == 'POST':
                key = request.data['key']
                result = Event.objects.filter(title__istartswith=key)
                events = serializers.serialize('json', result)
                print (key)
                print (result)
        data = {
                'events': events,

        }
        return Response(data)


Searching by the first letters of the key returns the correct values ​​if key is in English, if in Russian it returns [] for some reason, although there should be matches. It used to work, it's not clear at some point it broke. locally litsql . in selling postgresql

What could it be?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question