From 0c5c923b06b14344d6cf2454117254911b849800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 22 May 2023 23:06:16 +0200 Subject: [PATCH] =?UTF-8?q?Autocomplete=20=C5=99e=C5=A1itel=C5=AF:=20oprav?= =?UTF-8?q?a=20v=C3=ADceslovn=C3=A9ho=20hled=C3=A1n=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/views/autocomplete.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/views/autocomplete.py b/api/views/autocomplete.py index 601f4e35..84a915bf 100644 --- a/api/views/autocomplete.py +++ b/api/views/autocomplete.py @@ -37,9 +37,9 @@ class ResitelAutocomplete(LoginRequiredAjaxMixin,autocomplete.Select2QuerySetVie query = Q() for part in parts: query &= ( - Q(osoba__jmeno__istartswith=self.q)| - Q(osoba__prijmeni__istartswith=self.q)| - Q(osoba__prezdivka__istartswith=self.q) + Q(osoba__jmeno__istartswith=part)| + Q(osoba__prijmeni__istartswith=part)| + Q(osoba__prezdivka__istartswith=part) ) qs = qs.filter(query) return qs