def template_update_get(tpl_id):
    g.menu = 'templates'
    tpl_id = int(tpl_id)
    t = Template.get(tpl_id)
    if not t:
        return jsonify(msg='no such template')

    t.parent = Template.get(t.parent_id)
    ss = Strategy.select_vs(where='tpl_id = %s', params=[tpl_id], order='metric')
    t.action = Action.get(t.action_id)
    return render_template('template/update.html', data={'tpl': t, 'ss': ss, 'uic': UIC_ADDRESS['external']})
Exemple #2
0
def template_update_get(tpl_id):
    g.menu = 'templates'
    tpl_id = int(tpl_id)
    t = Template.get(tpl_id)
    if not t:
        return jsonify(msg='no such template')

    t.parent = Template.get(t.parent_id)
    ss = Strategy.select_vs(where='tpl_id = %s',
                            params=[tpl_id],
                            order='metric')
    t.action = Action.get(t.action_id)
    return render_template('template/update.html',
                           data={
                               'tpl': t,
                               'ss': ss,
                               'uic': UIC_ADDRESS['external']
                           })