Autocomplete řešitelů: oprava víceslovného hledání

This commit is contained in:
Jonas Havelka 2023-05-22 23:06:16 +02:00
parent 61e71efcc4
commit 0c5c923b06

View file

@ -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