-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add intermediary form config representation #37
Comments
We probably then need to create a place for admins to define whitelisted custom callables that they can reference in their JSON configs. We also need to predefine a few, and write a template function or class that assumes certain kwargs will be passed, like form_name, etc. We also need to find a way to handle python type representations in JSON strings. Finally, we need to add a bunch of validation checks against the JSON config at app start up, and when there is a change to the config - eg. in the admin console. This eventually will result in a new admin route for form configuration. |
This approach allows us to write everything in a config file and, put another way, everything is editable at runtime. The great thing about the form config is that it is encapsulated in a callable: |
Add support for plugin callables for field options and custom visualizations
Or maybe we allow admins to request all relational and document database data. I don't think we should automatically pass this data to all plugin callables, that would be bad security practice. |
Add support for multiple form config files |
Callables are outside the scope of this specific issue, but types are not. As such, part of me truly is beginning to believe that JSON is not the ideal intermediate representation system here... yaml, despite giving us another dependency (pyyaml) might actually do the trick much better. |
[api] [admin] add admin read form config route |
[api] [admin] add admin update form config route |
A perennial problem. Writing forms as a python dictionary is powerful but works against customization, eg. in the UI. Then, we specify a FORM_CONFIG_PATH str in the app config, which defaults to instance/form_config.json. Then, we load this file and validate it through our pydantic model each time the API is called, allowing rapid iteration.
The text was updated successfully, but these errors were encountered: