#86 Autocomplete enhancement
* adds support for title lookup on EcoAccounts * adds support for title lookup on Interventions * adds support for email lookup on User
This commit is contained in:
parent
402bc2d6f3
commit
6ea66180d1
@ -35,8 +35,9 @@ class EcoAccountAutocomplete(Select2QuerySetView):
|
|||||||
)
|
)
|
||||||
if self.q:
|
if self.q:
|
||||||
qs = qs.filter(
|
qs = qs.filter(
|
||||||
identifier__icontains=self.q
|
Q(identifier__icontains=self.q) |
|
||||||
)
|
Q(title__icontains=self.q)
|
||||||
|
).distinct()
|
||||||
return qs
|
return qs
|
||||||
|
|
||||||
|
|
||||||
@ -57,8 +58,9 @@ class InterventionAutocomplete(Select2QuerySetView):
|
|||||||
)
|
)
|
||||||
if self.q:
|
if self.q:
|
||||||
qs = qs.filter(
|
qs = qs.filter(
|
||||||
identifier__icontains=self.q
|
Q(identifier__icontains=self.q) |
|
||||||
)
|
Q(title__icontains=self.q)
|
||||||
|
).distinct()
|
||||||
return qs
|
return qs
|
||||||
|
|
||||||
|
|
||||||
@ -81,8 +83,9 @@ class ShareUserAutocomplete(Select2QuerySetView):
|
|||||||
if self.q:
|
if self.q:
|
||||||
# Due to privacy concerns only a full username match will return the proper user entry
|
# Due to privacy concerns only a full username match will return the proper user entry
|
||||||
qs = qs.filter(
|
qs = qs.filter(
|
||||||
username=self.q
|
Q(username=self.q) |
|
||||||
)
|
Q(email=self.q)
|
||||||
|
).distinct()
|
||||||
return qs
|
return qs
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user