示例#1
0
文件: manage.py 项目: yuzhou6/myflask
def deploy():
    """Run deploment tasks."""
    from flask.ext.migrate import upgrade
    from app.models import Role, User, Post, Category

    upgrade()

    Role.insert_roles()
    User.add_self_follows()
    Category.add_categorys()
    Post.add_default_title()
    Post.add_default_category()
示例#2
0
文件: manage.py 项目: ldhust/Eblog
def deploy():
    """Run deploment tasks."""
    from flask.ext.migrate import upgrade
    from app.models import Role, User, Post, Category

    upgrade()

    Role.insert_roles()
    User.add_self_follows()
    Category.add_categorys()
    Post.add_default_title()
    Post.add_default_category()
示例#3
0
def deploy():
    '''运行部署任务'''
    #将数据库迁移到最新版
    upgrade()

    #创建或更新用户角色
    Role.insert_roles()

    #确保所有用户都关注了自己
    User.add_self_follows()

    #更新目录分类
    Category.add_categorys()

    #添加默认标题
    Post.add_default_title()

    #添加默认分类
    Post.add_default_category()