From 0ec0194197b848e3bd2eb6eb715d1f6af9e39b65 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 15 Sep 2019 21:39:00 +0200 Subject: Criteria search: do not use textarea for custom fields --- ishtar_common/forms.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ishtar_common/forms.py') diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 76b33b638..24972ed3b 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -278,6 +278,7 @@ class CustomForm(BSForm): :return: ((order1, key1, field1), ...) """ fields = [] + is_search = "search_vector" in cls.base_fields q = custom_form.json_fields.values( 'label', 'help_text', 'order', 'json_field__key', 'json_field__value_type', 'json_field__name', @@ -288,6 +289,8 @@ class CustomForm(BSForm): if field['json_field__value_type'] in JSON_VALUE_TYPES_FIELDS: field_cls, widget = JSON_VALUE_TYPES_FIELDS[ field['json_field__value_type']] + if is_search and field['json_field__value_type'] == "LT": + widget = None attrs = {'label': field['label'] or field['json_field__name'], 'required': False} if field['help_text']: -- cgit v1.2.3