def expression_add_get(): a = None o = Expression.get(int(request.args.get('id', '0').strip())) if o: a = Action.get(o.action_id) return render_template('portal/expression/add.html', data={'action': a, 'expression': o})
def expression_view_get(eid): eid = int(eid) a = None o = Expression.get(eid) if o: a = Action.get(o.action_id) else: return 'no such expression' return render_template('portal/expression/view.html', data={'action': a, 'expression': o})
def expression_pause_get(): expression_id = request.args.get("id", '') pause = request.args.get('pause', '') if not expression_id: return jsonify(msg='id is blank') if not pause: return jsonify(msg='pause is blank') e = Expression.get(expression_id) if not e: return jsonify('no such expression %s' % expression_id) Expression.update_dict({'pause': pause}, 'id=%s', [expression_id]) return jsonify(msg='')
def api_expression_get(exp_id): exp_id = int(exp_id) expression = Expression.get(exp_id) if not expression: return jsonify(msg="no such expression") return jsonify(msg='', data=expression.to_json())