summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authord42 <d42@users.noreply.github.com>2018-04-28 20:44:47 +0200
committerd42 <d42@users.noreply.github.com>2018-04-28 20:45:02 +0200
commit3ae860dbcef967813419949a3c80c7abd4d71a54 (patch)
treee0bdd6fb93eb999a6bf174224e9d7ec4e6a3c983
parenta9a1e77d91da5a7cec9968e9af52a10acfe95514 (diff)
downloadspejstore-3ae860dbcef967813419949a3c80c7abd4d71a54.tar.gz
spejstore-3ae860dbcef967813419949a3c80c7abd4d71a54.tar.bz2
spejstore-3ae860dbcef967813419949a3c80c7abd4d71a54.zip
smart search in parent select
-rw-r--r--storage/views.py2
-rw-r--r--storage/widgets.py4
2 files changed, 1 insertions, 5 deletions
diff --git a/storage/views.py b/storage/views.py
index dafe2b4..b5ebec6 100644
--- a/storage/views.py
+++ b/storage/views.py
@@ -99,7 +99,7 @@ class ItemSelectView(AutoResponseView):
def get(self, request, *args, **kwargs):
self.widget = self.get_widget_or_404()
self.term = kwargs.get('term', request.GET.get('term', ''))
- self.object_list = self.get_queryset()
+ self.object_list = apply_smart_search(self.term, Item.objects)
context = self.get_context_data()
return JsonResponse({
'results': [
diff --git a/storage/widgets.py b/storage/widgets.py
index b887056..8c254d6 100644
--- a/storage/widgets.py
+++ b/storage/widgets.py
@@ -13,10 +13,6 @@ from django.contrib.admin.widgets import AdminTextareaWidget
class ItemSelectWidget(ModelSelect2Widget):
- search_fields = [
- 'name__icontains',
- 'description__icontains'
- ]
def __init__(self, *args, **kwargs):
kwargs['data_view'] = 'item-complete'