简体   繁体   中英

How to exclude column from create, but validate in edit in flask-admin?

To remove fields from the create and edit forms:

form_excluded_columns = ['last_name', 'email']

I want to label edited rows with comments. For example we create row with columns: name, count, payment. After we edit payment column, we MUST append comment about why we change this.

How to apply such behavior in flask-admin?

Thanks

form_create_rules = [rules.FieldSet('name', 'count', 'payment')]
form_edit_rules = [rules.FieldSet('comment')]
form_args = dict(comment=dict(validators=[required()]))

Solve my problem, but I can't reject the feeling, I'm doing something wrong.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM