From b832ca6b00343c34e7289cec3f42d6bc2f8695ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Cl=C3=A9rice?= Date: Sun, 25 Feb 2018 15:51:04 +0100 Subject: [PATCH] Fixed #42 - Improved loading time of autocomplete by not loading full DB. --- app/main/views/corpus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main/views/corpus.py b/app/main/views/corpus.py index fc737469..8f0ccb62 100644 --- a/app/main/views/corpus.py +++ b/app/main/views/corpus.py @@ -84,7 +84,7 @@ def corpus_allowed_values_api(corpus_id, allowed_type): group_by=True, type_like=allowed_type, allowed_list=corpus.get_allowed_values(allowed_type=allowed_type).count() > 0 - ).all() + ).limit(10) if result is not None ] )