Flask Admin ModelView different fields between CREATE and EDIT

感情迁移 提交于 2019-12-07 04:08:18

问题


In a Flask app using Flask Admin I would like to be able to define different form fields in the Edit section of a ModelView than those in the Create section.

The form_columns setting applies to both Create and Edit, but I can't seem to find a way to give different sets of columns to each section.


回答1:


You can use form_edit_rules and form_create_rules to override form columns/fields.



来源:https://stackoverflow.com/questions/31797671/flask-admin-modelview-different-fields-between-create-and-edit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!