diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2022-01-05 20:30:42 +0100 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2022-01-05 20:30:54 +0100 |
commit | 576cdae5270b12b36b8a522ce37fac26d46dbde9 (patch) | |
tree | b5fdd3d657c75510ff1faab35098650445ded4fb /client/templatetags/app_filter.py | |
parent | force user linked to midata to use midata login (diff) | |
download | scout-subs-576cdae5270b12b36b8a522ce37fac26d46dbde9.tar.gz scout-subs-576cdae5270b12b36b8a522ce37fac26d46dbde9.zip |
add radio buttons to custom parameters
Diffstat (limited to '')
-rw-r--r-- | client/templatetags/app_filter.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/client/templatetags/app_filter.py b/client/templatetags/app_filter.py index 9f378e1..df92775 100644 --- a/client/templatetags/app_filter.py +++ b/client/templatetags/app_filter.py @@ -34,4 +34,16 @@ def doc_count(doc): if doc.max_instances != 0: doc_count += "/" + str(doc.max_instances) - return doc_count
\ No newline at end of file + return doc_count + +@register.filter(name="parse_multiple_choice") +def parse_multiple_choice(str): + if len(str) < 3: + return [str, []] + + str = str[3:] + arr = str.split(",") + if len(arr) < 2: + return [arr[0], []] + + return [arr[0], arr[1:]]
\ No newline at end of file |