diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-07-02 20:22:10 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-13 18:26:03 +0200 |
commit | 94f1e5957436a128c1fe8b543f3b2d1ae65093e4 (patch) | |
tree | 371b9f82f5a988972b3773327d3949a95dbb15e0 /ishtar_common | |
parent | 6029e4f0e58451848e2c4812d107aae190aa10c7 (diff) | |
download | Ishtar-94f1e5957436a128c1fe8b543f3b2d1ae65093e4.tar.bz2 Ishtar-94f1e5957436a128c1fe8b543f3b2d1ae65093e4.zip |
Full text search: open search in facets (refs #4180)
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/views_item.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index a2cc0762c..675c36575 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -751,8 +751,9 @@ def get_item(model, func_name, default_name, extra_request_keys=[], if val.startswith(u'"') and val.startswith(u'"'): # manage search text by label - if u"%" in val: + if u"*" in val: suffix = "label__icontains" + val = val.replace(u'*', u"") else: suffix = "label__iexact" val = val[1:-1] @@ -788,9 +789,9 @@ def get_item(model, func_name, default_name, extra_request_keys=[], for val in values: if not val.endswith(u'"') or not val.startswith(u""): continue - query = val[1:-1] suffix = "__label__icontains" if u"%" in val else \ "__label__iexact" + query = val[1:-1].replace(u'*', u"") if not reqs: reqs = Q(**{base_k + suffix: query}) else: |