我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用flask_admin.contrib.sqla.ModelView()。
def mix(*classes): class Mixed(*classes): pass # noqa return Mixed # class AlbumView(ModelView): # @property # def column_list(self): # return self.scaffold_list_columns() + ["infohash"]
def register_admin(admin, app): from .models import Intent, BibleVerse, User basic_auth = BasicAuth(app) ModelView.setup_basic_auth(basic_auth) admin.add_view(ModelView(Intent, db.session)) admin.add_view(ModelView(BibleVerse, db.session)) admin.add_view(ModelView(User, db.session))
def second_page(self): return self.render('admin/second_page.html') #ModelView ???? SQLAlchemy Model, ???? CRUD ????????.