Browse Source

fix autocomplete řešitelů nemá být case-sensitive

middleware_test
Jonas Havelka 3 years ago
parent
commit
e39ccd14b7
  1. 6
      seminar/views/autocomplete.py

6
seminar/views/autocomplete.py

@ -23,9 +23,9 @@ class ResitelAutocomplete(LoginRequiredAjaxMixin,autocomplete.Select2QuerySetVie
qs = m.Resitel.objects.all() qs = m.Resitel.objects.all()
if self.q: if self.q:
qs = qs.filter( qs = qs.filter(
Q(osoba__jmeno__startswith=self.q)| Q(osoba__jmeno__istartswith=self.q)|
Q(osoba__prijmeni__startswith=self.q)| Q(osoba__prijmeni__istartswith=self.q)|
Q(osoba__prezdivka__startswith=self.q) Q(osoba__prezdivka__istartswith=self.q)
) )
return qs return qs

Loading…
Cancel
Save