app_routes.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:spc 作者: whbrewer 项目源码 文件源码
def view_app(app):
    user = root.authorized()
    if app: root.set_active(app)
    else: redirect('/myapps')

    if user != 'admin':
        return template('error', err="must be admin to edit app")
    cid = request.query.cid
    result = db(apps.name==app).select().first()
    params = {}
    params['app'] = app
    params['user'] = user
    params['cid'] = cid
    #if request.query.edit:
    #    return template('appedit', params, rows=result)
    #else:
    try:
        return template('app', params, rows=result)
    except:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print traceback.print_exception(exc_type, exc_value, exc_traceback)
        return template('error', err="there was a problem showing the app template. Check traceback.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号