Example #1
0
def node_add_update(db, render):
    form = node_forms.node_update_form()
    if not form.validates(source=request.forms):
        return render("base_form", form=form)
    node = db.query(models.SlcNode).get(form.d.id)
    node.node_name = form.d.node_name
    node.node_desc = form.d.node_desc

    ops_log = models.SlcRadOperateLog()
    ops_log.operator_name = get_cookie("username")
    ops_log.operate_ip = get_cookie("login_ip")
    ops_log.operate_time = utils.get_currtime()
    ops_log.operate_desc = u'操作员(%s)修改区域信息:%s' % (get_cookie("username"), node.node_name)
    db.add(ops_log)

    db.commit()
    redirect("/node")
Example #2
0
def node_add_update(db, render):
    form = node_forms.node_update_form()
    if not form.validates(source=request.forms):
        return render("base_form", form=form)
    node = db.query(models.SlcNode).get(form.d.id)
    node.node_name = form.d.node_name
    node.node_desc = form.d.node_desc

    ops_log = models.SlcRadOperateLog()
    ops_log.operator_name = get_cookie("username")
    ops_log.operate_ip = get_cookie("login_ip")
    ops_log.operate_time = utils.get_currtime()
    ops_log.operate_desc = u'操作员(%s)修改区域信息:%s' % (get_cookie("username"),
                                                  node.node_name)
    db.add(ops_log)

    db.commit()
    redirect("/node")
Example #3
0
def node_update(db, render):
    node_id = request.params.get("node_id")
    form = node_forms.node_update_form()
    form.fill(db.query(models.SlcNode).get(node_id))
    return render("base_form", form=form)
Example #4
0
def node_update(db, render):
    node_id = request.params.get("node_id")
    form = node_forms.node_update_form()
    form.fill(db.query(models.SlcNode).get(node_id))
    return render("base_form", form=form)