Exemple #1
0
def strategy_get(sid):
    sid = int(sid)
    s = Strategy.get(sid)
    if not s:
        return jsonify(msg='no such strategy')

    return jsonify(msg='', data=s.to_json())
Exemple #2
0
def strategy_get(sid):
    sid = int(sid)
    s = Strategy.get(sid)
    if not s:
        return jsonify(msg='no such strategy')

    return jsonify(msg='', data=s.to_json())
Exemple #3
0
def strategy_delete_get(sid):
    sid = int(sid)
    s = Strategy.get(sid)
    if not s:
        return jsonify(msg='no such strategy')

    Strategy.delete_one(sid)

    return jsonify(msg='')
Exemple #4
0
def strategy_delete_get(sid):
    sid = int(sid)
    s = Strategy.get(sid)
    if not s:
        return jsonify(msg='no such strategy')

    Strategy.delete_one(sid)

    return jsonify(msg='')
Exemple #5
0
def strategy_delete_get(sid):
    sid = int(sid)
    s = Strategy.get(sid)
    if not s:
        return jsonify(msg='no such strategy')

    Hook.delete(where="strategy_id={id}".format(id=sid))
    Strategy.delete_one(sid)

    return jsonify(msg='')
Exemple #6
0
def strategy_list_hook(sid):
    sid = int(sid)
    s = Strategy.get(sid)
    if not s:
        return jsonify(msg='no such strategy')

    hooks = Hook.select_vs(where="strategy_id={id}".format(id=sid))
    data = []
    for hook in hooks:
        data.append(hook.to_json())
    return jsonify(msg='', data=data)
Exemple #7
0
def api_strategy_get(s_id):
    s_id = int(s_id)
    s = Strategy.get(s_id)
    if not s:
        return jsonify(msg="no such strategy")
    return jsonify(msg='', data=s.to_json())
Exemple #8
0
def api_strategy_get(s_id):
    s_id = int(s_id)
    s = Strategy.get(s_id)
    if not s:
        return jsonify(msg="no such strategy")
    return jsonify(msg='', data=s.to_json())