From e267c10d2ef6c314bc6201e67b7d382e3aac139d Mon Sep 17 00:00:00 2001 From: Peter Andorfer Date: Sun, 10 Nov 2024 09:18:48 +0100 Subject: [PATCH] order autocompletes by id (#248) --- apis_core/apis_entities/autocomplete3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis_core/apis_entities/autocomplete3.py b/apis_core/apis_entities/autocomplete3.py index aaeb953..3b93a26 100644 --- a/apis_core/apis_entities/autocomplete3.py +++ b/apis_core/apis_entities/autocomplete3.py @@ -113,7 +113,7 @@ def get(self, request, *args, **kwargs): Q(**{x + search_type: q}) for x in settings.APIS_ENTITIES[ac_type.title()]["search"] ] - res = ent_model.objects.filter(reduce(operator.or_, arg_list)).distinct() + res = ent_model.objects.filter(reduce(operator.or_, arg_list)).order_by('id').distinct() if q3: f_dict2 = {} for fd in q3: