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())
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='')
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='')
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)
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())