-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a patch for snippet chooser autocomplete
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From d1f371bdcb803d06447999e1cf3e934da9297168 Mon Sep 17 00:00:00 2001 | ||
From: Donald Buczek <buczek@molgen.mpg.de> | ||
Date: Tue, 19 Nov 2019 15:27:16 +0100 | ||
Subject: [PATCH] Hack snippets chooser to use autocomplete | ||
|
||
Users wanted to have partial search when Contacts are selected by the | ||
Chooser. The Chooser doesn't have the feature to use partial matches and | ||
our postgres_search doesn't support it in its search() method anyway. | ||
Try to get away with changing the Chooserd to use autocomplete(). | ||
--- | ||
lib/python3.7/site-packages/wagtail/snippets/views/chooser.py | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/lib/python3.7/site-packages/wagtail/snippets/views/chooser.py b/lib/python3.7/site-packages/wagtail/snippets/views/chooser.py | ||
index adffdef..74de073 100644 | ||
--- a/lib/python3.7/site-packages/wagtail/snippets/views/chooser.py | ||
+++ b/lib/python3.7/site-packages/wagtail/snippets/views/chooser.py | ||
@@ -34,7 +34,7 @@ def choose(request, app_label, model_name): | ||
search_query = search_form.cleaned_data['q'] | ||
|
||
search_backend = get_search_backend() | ||
- items = search_backend.search(search_query, items) | ||
+ items = search_backend.autocomplete(search_query, items) | ||
is_searching = True | ||
|
||
else: | ||
-- | ||
2.22.0 | ||
|