views.py 文件源码

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

项目:airflow 作者: apache-airflow 项目源码 文件源码
def action_varexport(self, ids):
        V = models.Variable
        session = settings.Session()
        qry = session.query(V).filter(V.id.in_(ids)).all()
        session.close()

        var_dict = {}
        d = json.JSONDecoder()
        for var in qry:
            val = None
            try:
                val = d.decode(var.val)
            except:
                val = var.val
            var_dict[var.key] = val

        response = make_response(json.dumps(var_dict, sort_keys=True, indent=4))
        response.headers["Content-Disposition"] = "attachment; filename=variables.json"
        return response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号