Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

exclude specific fields in flask-admin's create/edit forms

I have some fields in my models which I specifically want to exclude from my ModelView.

Reference https://flask-admin.readthedocs.org/en/latest/api/mod_model/, I attempted to exclude those specific fields using form_exclude_columns, e.g.

class UserView(ModelView):

    form_exclude_columns = ('created', 'modified')

But that doesn't seem to work.

How can I easily exclude these two fields in my create and edit ModelView pages?

like image 500
Calvin Cheng Avatar asked Apr 24 '14 04:04

Calvin Cheng


1 Answers

The attribute should be named form_excluded_columns. You forgot the 'd'.

class UserView(ModelView):

    form_excluded_columns = ('created', 'modified')
like image 100
dirn Avatar answered Sep 19 '22 22:09

dirn