summaryrefslogtreecommitdiff
path: root/ishtar_common/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-02-13 13:23:29 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-02-13 13:23:29 +0100
commitbf6fa71e7f161896cd114a2033d7688f98d49f8e (patch)
treeaead69cdc27743add5535450c812c8ce9d440584 /ishtar_common/forms.py
parent5330e9b9622107a17a170cc2d3761dafbf15b8ae (diff)
downloadIshtar-bf6fa71e7f161896cd114a2033d7688f98d49f8e.tar.bz2
Ishtar-bf6fa71e7f161896cd114a2033d7688f98d49f8e.zip
Manage search on json fields - HistorySelect for all concerned forms
Diffstat (limited to 'ishtar_common/forms.py')
-rw-r--r--ishtar_common/forms.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py
index 754f63f74..d697ee89b 100644
--- a/ishtar_common/forms.py
+++ b/ishtar_common/forms.py
@@ -273,6 +273,11 @@ class CustomForm(BSForm):
@classmethod
def _get_json_fields(cls, custom_form):
+ """
+ Return json field list from database configuration
+ :param custom_form: form concerned
+ :return: ((order1, key1, field1), ...)
+ """
fields = []
for field in custom_form.json_fields.order_by('order').all():
key = "data__" + field.json_field.key
@@ -299,6 +304,11 @@ class CustomForm(BSForm):
@classmethod
def check_custom_form(cls, current_user):
+ """
+ Check form customization
+ :param current_user:
+ :return: available, excluded_fields, json_fields
+ """
if not current_user:
return True, [], []
base_q = {"form": cls.form_slug, 'available': True}