-
Notifications
You must be signed in to change notification settings - Fork 0
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
Slot field options #5
Comments
We will avoid to procrastinate on this feature because of the front question since it is an important feature. Let's start with JSON edition for now, we will see further to improve its usage. |
The 'Schema' way may not be the best choice. It is more difficult to write slot definition and more complicated to validate and use. What if instead, we simply use a Django form for each definition, since its field are naturally validated, easier to define and may even be used to simply render its fields instead of using a frontend library like json-editor to render the options JSON and manage it in the Slot form. The idea would be to define a form for each definition, this form will contains an input field for each option element from the JSON structure. Option form field to manage the |
Coming back to this and while the idea to make it full backend, i remember it to be complicated and very frustrating to build virtual fields for options in the model form of Slot admin. Model form in the Django admin context has many constraints. Worth to notice that since i was working on this, i found other JS libraries for a JSON field:
|
Canopy stands on internal slot definitions to build the form fields.
We don't want to be like django-fobi that did have too many options for each field types but we will probably needs a little bit of options, like with an Integer field, you would expect to set a minimum and a maximum limit from the Slot options.
Since there would be too many options to modelize from various Django form field or widget, we just can not add them all to the Slot model, so it will need to be stored as JSON.
This leads to a problem, editing JSON is not user friendly at all so we would need something to turn the JSON to virtual fields that can be humanly edited.
There is a very nice frontend module for this with json-editor library. However, it needs to be implemented properly in the Slot form.
There was a Django app for this before with django-admin-json-editor but it is stale since some years, however it may helps to implement again.
The text was updated successfully, but these errors were encountered: