I have a User
model class and password
is one attribute among many. I am using Flask web framework and Flask-Admin extension to create the admin view o
You should extend your view from ModelView and overwrite the necessary fields.
In my class it looks like this:
class UserView(ModelView):
column_list = ('first_name', 'last_name', 'username', 'email')
searchable_columns = ('username', 'email')
# this is to exclude the password field from list_view:
excluded_list_columns = ['password']
can_create = True
can_delete = False
# If you want to make them not editable in form view: use this piece:
form_widget_args = {
'name': {
'readonly': True
},
}
Hope this helps! For more information check out the documentation: