api.py 文件源码

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

项目:rforms 作者: Jakeable 项目源码 文件源码
def settings():
    # returns data about the current settings
    i = inspect(db.engine)
    cols = i.get_columns("Settings")
    ignore = [
        'id',
        'questions',
        'required_ids',
        'response_body',
        'min_age_word']
    out = {}
    for col in cols:
        # don't include things that can't be modified in the settings menu
        if col["name"].lower() in ignore:
            continue

        col_dict = {}
        col_dict["value"] = getattr(g.settings, col["name"])
        col_dict["type"] = type(col_dict["value"]).__name__
        out[col["name"].lower()] = col_dict

    return Response(json.dumps(out), mimetype="application/json")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号