From 9ae3147e4e277459e3094d9b82cf0dba60ecc172 Mon Sep 17 00:00:00 2001 From: Gregory Trullemans Date: Thu, 13 Oct 2022 21:05:20 +0200 Subject: [PATCH] Allow searching skill by notation --- ultron/objective/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ultron/objective/views.py b/ultron/objective/views.py index c475af95eb..03b610aec0 100644 --- a/ultron/objective/views.py +++ b/ultron/objective/views.py @@ -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