def start_views(app, db): admin = Admin(app, name='Dashboard', base_template='admin/base.html', template_mode='bootstrap3', index_view=HomeView()) admin.add_view(GenericView(Role, db.session, "Funções")) admin.add_view(UserView(User, db.session, "Usuários", category="Usuários")) admin.add_view(GenericView(State, db.session, "Estados")) admin.add_view( GenericView(Disease, db.session, "Doenças", category="Clínico")) admin.add_view( GenericView(Patient, db.session, "Pacientes", category="Clínico")) admin.add_view( GenericView(DiseaseState, db.session, "Estados de Saúde", category="Clínico")) admin.add_link(MenuLink(name='Logout', url='/logout'))
def register_admin_views(admin): admin.add_view(UserView(User)) admin.add_view(RoleView(Role)) return None
def register_admin_views(admin): admin.add_view(UserView(User, db.session)) admin.add_view(RoleView(Role, db.session)) return None