当前位置: 首页>>代码示例>>Python>>正文


Python Admin.setup方法代码示例

本文整理汇总了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
开发者ID:shanzi,项目名称:code-vilya,代码行数:9,代码来源:__init__.py

示例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
开发者ID:fspot,项目名称:flask-peewee-example,代码行数:10,代码来源:admin.py

示例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()
开发者ID:tlodge,项目名称:dataware.experiment_v2,代码行数:33,代码来源:runserver.py

示例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()
开发者ID:michaeljoseph,项目名称:erlenmeyer,代码行数:7,代码来源:extension.py


注:本文中的flask_peewee.admin.Admin.setup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。