Browse Source

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

vyroci-fix
Jonas Havelka 2 years ago
parent
commit
0c5c923b06
  1. 6
      api/views/autocomplete.py

6
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

Loading…
Cancel
Save