You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some background that may help...
(this may be obvious, if so sorry!)
In terms of fields with options 4 template tags exist input, select, radio and radio_vertical .
Input renders an input field that is free text but with autocomplete options, select is an html select tag and radio/radio_vertical are radio button fields.
When you run python manage.py scaffold. opal.core.scaffold renders opal/core/scaffolding/record_templates/record_form.jinja2
This looks at the schema for the field (the schema is a serialized version of the model structure) and if its a charfield (ie type string in the schema) it renders an input template tag, with the autocomplete options.
However the most common case we have found that is if you are rendering a charfield with choices is that you want a radio field.
In the schema the choices are serialized in the enum field of the schema.
The solution is that in the record_form.jinja2 check that a field is a string field and check to see if the enum field is populated and if so to use a radio field.
at the moment if we scaffold an app with a charfield with choices field it will put in an input field, lets use a radio field
The text was updated successfully, but these errors were encountered: