summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/views_item.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py
index 4247e224a..821a6635f 100644
--- a/ishtar_common/views_item.py
+++ b/ishtar_common/views_item.py
@@ -1159,11 +1159,17 @@ def _manage_clean_search_field(dct, exclude=None):
if "*" not in dct[k] or not k.endswith("__iexact"):
continue
value = dct.pop(k).strip()
+ base_key = k[:-len("__iexact")]
+ if value == "*":
+ dct[base_key + "__isnull"] = False
+ # TODO search
+ #if exclude is not None:
+ # exclude[base_key + "__exact"] = ""
+ continue
if value.startswith("*"):
value = value[1:]
if value.endswith("*"):
value = value[:-1]
- base_key = k[: -len("__iexact")]
if value:
dct[base_key + "__icontains"] = value
elif exclude is not None:
@@ -2052,8 +2058,11 @@ def get_item(
if "exc_and_reqs" in dct:
exc_and_reqs += dct.pop("exc_and_reqs")
- _manage_clean_search_field(dct, excluded_dct)
+ updated_excluded = {}
+ _manage_clean_search_field(dct, updated_excluded)
_manage_clean_search_field(excluded_dct, dct)
+ if updated_excluded:
+ excluded_dct.update(updated_excluded)
query = _construct_query(relation_types, dct, or_reqs, and_reqs)
exc_query = None