views.py 文件源码

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

项目:ostip 作者: kx499 项目源码 文件源码
def api_indicator_get():
    req_keys = ('conditions',)
    req_keys2 = ('field', 'operator', 'val')
    try:
        pld = request.get_json(silent=True)
    except Exception, e:
        return json.dumps({'results': 'error', 'data': '%s' % e})

    if not _valid_json(req_keys, pld):
        return json.dumps({'results': 'error', 'data': 'Invalid json'})

    for item in pld.get('conditions'):
        if not _valid_json(req_keys2, item):
            return json.dumps({'results': 'error', 'data': 'Invalid json'})

    q = filter_query(Indicator.query.join(Event), pld.get('conditions'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号