* extends KonovaCode filtering for parent objects matching given input
This commit is contained in:
mipel 2021-09-29 11:44:07 +02:00
parent ea0a07890c
commit 49a9d03471

View File

@ -107,7 +107,9 @@ class KonovaCodeAutocomplete(Select2QuerySetView):
q_or = Q() q_or = Q()
q_or |= Q(long_name__icontains=self.q) q_or |= Q(long_name__icontains=self.q)
q_or |= Q(short_name__icontains=self.q) q_or |= Q(short_name__icontains=self.q)
qs = qs.filter(q_or) q_or |= Q(parent__long_name__icontains=self.q)
q_or |= Q(parent__short_name__icontains=self.q)
qs = qs.filter(q_or).distinct()
return qs return qs