<s> from flask_admin . contrib . sqlamodel import ModelView <EOL> from flask_wtf import PasswordField , required <EOL> from . . core . ext import admin <EOL> from . models import User , Role , Key <EOL> class UserView ( ModelView ) : <EOL> column_filters = '<STR_LIT:username>' , '<STR_LIT:email>' <EOL> column_list = '<STR_LIT:username>' , '<STR_LIT:email>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' <EOL> form_excluded_columns = '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' <EOL> def scaffold_form ( self ) : <EOL> form = super ( UserView , self ) . scaffold_form ( ) <EOL> form . pw_hash = PasswordField ( validators = [ required ( ) ] ) <EOL> form . roles . kwargs [ '<STR_LIT>' ] = [ ] <EOL> return form <EOL> admin . add_model ( User , UserView ) <EOL> admin . add_model ( Role ) <EOL> admin . add_model ( Key ) </s>
