本文整理汇总了Python中flask_peewee.admin.Admin.setup方法的典型用法代码示例。如果您正苦于以下问题:Python Admin.setup方法的具体用法?Python Admin.setup怎么用?Python Admin.setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flask_peewee.admin.Admin
的用法示例。
在下文中一共展示了Admin.setup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_app
# 需要导入模块: from flask_peewee.admin import Admin [as 别名]
# 或者: from flask_peewee.admin.Admin import setup [as 别名]
def create_app(settings_override=None):
app = factory.create_app(__name__, __path__, settings_override)
admin = Admin(app, auth)
register_admin(admin)
admin.setup()
return app
示例2: setup_admin
# 需要导入模块: from flask_peewee.admin import Admin [as 别名]
# 或者: from flask_peewee.admin.Admin import setup [as 别名]
def setup_admin():
auth = Auth(app, db)
admin = Admin(app, auth)
admin.register(Note, NoteAdmin)
admin.register(Author, AuthorAdmin)
auth.register_admin(admin)
admin.setup()
return auth, admin
示例3: Admin
# 需要导入模块: from flask_peewee.admin import Admin [as 别名]
# 或者: from flask_peewee.admin.Admin import setup [as 别名]
import psyc.models.execution as execution
from gevent.wsgi import WSGIServer
from flask_peewee.admin import Admin
port = 9080
auth.User.create_table(fail_silently=True)
url.Url.create_table(fail_silently=True)
resource.Resource.create_table(fail_silently=True)
catalog.Catalog.create_table(fail_silently=True)
processor.Processor.create_table(fail_silently=True)
execution.Execution.create_table(fail_silently=True)
admin = Admin(app,auth)
auth.register_admin(admin)
admin.register(url.Url, url.UrlAdmin)
admin.register(resource.Resource, resource.ResourceAdmin)
admin.register(catalog.Catalog, catalog.CatalogAdmin)
admin.register(processor.Processor, processor.ProcessorAdmin)
admin.register(execution.Execution, execution.ExecutionAdmin)
admin.setup()
import psyc.rest
import psyc.views
catalog.register()
#app.run(host='0.0.0.0', port=port, debug=True)
http_server = WSGIServer(('', port), app)
http_server.serve_forever()
示例4: init_admin
# 需要导入模块: from flask_peewee.admin import Admin [as 别名]
# 或者: from flask_peewee.admin.Admin import setup [as 别名]
def init_admin(app, auth, models):
admin = Admin(app, auth)
for model in models:
admin.register(model)
admin.setup()