dispatcher.py 文件源码

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

项目:opennms_alarmforwarder 作者: NETHINKS 项目源码 文件源码
def get_source(name):
    orm_session = model.Session()
    source = orm_session.query(model.Source).filter(model.Source.source_name==name).first()
    orm_session.close()
    if source is None:
        error_msg = "Source " + name + " not found!"
        if json_check():
            return json_error(error_msg, 404)
        flash(error_msg, "alert-danger")
        return redirect("/sources")
    if json_check():
        return jsonify(source.dict_repr())
    return render_template("source_view.html.tpl", source=source)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号