Allow searching skill by notation
This commit is contained in:
parent
94da55e019
commit
9ae3147e4e
|
@ -32,7 +32,9 @@ def skill_lookup(request):
|
|||
# Ignore queries shorter than length 2
|
||||
if pattern is not None and len(pattern) > 2:
|
||||
model_results = Skill.objects.filter(
|
||||
Q(short_label__icontains=pattern) | Q(long_label__icontains=pattern)
|
||||
Q(short_label__icontains=pattern)
|
||||
| Q(long_label__icontains=pattern)
|
||||
| Q(notation__icontains=pattern)
|
||||
)
|
||||
results = [
|
||||
{"ID": x.id, "Name": str(x), "Notation": x.notation} for x in model_results
|
||||
|
|
Loading…
Reference in New Issue