|
|
@ -26,11 +26,15 @@ class ResitelAutocomplete(LoginRequiredAjaxMixin,autocomplete.Select2QuerySetVie |
|
|
|
def get_queryset(self): |
|
|
|
qs = m.Resitel.objects.all() |
|
|
|
if self.q: |
|
|
|
qs = qs.filter( |
|
|
|
Q(osoba__jmeno__istartswith=self.q)| |
|
|
|
Q(osoba__prijmeni__istartswith=self.q)| |
|
|
|
Q(osoba__prezdivka__istartswith=self.q) |
|
|
|
parts = self.q.split() |
|
|
|
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) |
|
|
|
) |
|
|
|
qs = qs.filter(query) |
|
|
|
return qs |
|
|
|
|
|
|
|
class OdevzdatelnyProblemAutocomplete(autocomplete.Select2QuerySetView): |
|
|
|