-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
enhancementNew feature or requestNew feature or request
Description
1. Usage examples
To get the idea, see:
- An example with JSONLogic: https://formio.github.io/formio.js/app/examples/conditions.html
- Form Builder (GUI) example below.
2. (formio.js) Field Logic Schema
https://github.com/formio/formio.js/wiki/Field-Logic-Schema
3. Implementation suggestions
(1) Maybe useful library
https://github.com/PiotrDabkowski/Js2Py
(2) Dict to variables in scope
https://stackoverflow.com/questions/18090672/convert-dictionary-entries-into-variables-python
Also used in EXAMPLE below.
>>> from types import SimpleNamespace
>>> d = {'a': 123, 'b': 456}
>>> n = SimpleNamespace(**d)
>>> n.a
123EXAMPLE code
class Component:
def __init__():
self.show = True
def _set_show(self):
form_data = SimpleNamespace(**self.form)
...
def load(self, parent=None, data=None, renderer=None):
self.load_data(data)
# NEW set_show
self._set_show()4. Form Builder (config)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
