column_editable_list doesn't support SelectField
See original GitHub issueHere is my code for user model
class UserView(ModelView):
column_editable_list = ('username', 'email', 'status')
form_overrides = dict(
status=SelectField
)
form_args = dict(
status=dict(
choices=[
('ACTIVE', 'ACTIVE'),
('DELETED', 'DELETED'),
('BLOCKED', 'BLOCKED')
]
)
)
On removing ‘status’ from column_editable_list, it works fine (for username and email), otherwise we get Exception: Unsupported field type: <class 'wtforms.fields.core.SelectField'>
how do I solve this?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Edit a list column - Microsoft Support
Hover and click the down arrow on any of the list headings, and then click Column settings>Show/hide columns. click the down arrow on...
Read more >Restricted access to dropdown column - Submit an Idea
I have a dropdown column and I want to restrict the permission to edit the options, but keep users enabled to select the...
Read more >jqgrid incorrect select drop down option values in edit box
When I edit a record which contained Country id=2 (UK) and State id=6 (Oxford) , the edit form will shows correctly - Country...
Read more >Solved: How do I edit the columns in a list view as an adm...
Any user that has made changes will have to click the gear on their list view and then select Reset to Column defaults...
Read more >Excel drop down list: how to create, edit, copy and remove
If you select the whole column, a drop down menu will be created in each cell ... the In-cell dropdown box is checked;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@subhamagr Sorry, I tried to use Select2Field, avoid ‘Unsupported field type’, but failed to set choices. But for me, I use peewee, give choices in the model class:
Then override the XEditableWidget to support peewee’s SelectChoicesField:
Finally in my admin view, use my fixed widget to scaffold list view:
The way to override the list view field, see the document: http://flask-admin.readthedocs.io/en/latest/api/mod_model/?highlight=column_exclude_list#flask_admin.model.BaseModelView.get_list_form
If this can’t help you, we can discuss further.
@mrjoes This issue can be closed (per #1742, it is resolved)