示例#1
0
文件: api.py 项目: nevernet/pydelo
def api_update_user_hosts_by_id(id):
    user = users.get(id)
    user.hosts = []
    for host in request.form.getlist("hosts[]"):
        user.hosts.append(hosts.get(int(host)))
    users.save(user)
    return jsonify(dict(rc=0))
示例#2
0
文件: api.py 项目: zq920320/pydelo
def api_update_user_hosts_by_id(id):
    user = users.get(id)
    user.hosts = []
    for host in request.form.getlist("hosts[]"):
        user.hosts.append(hosts.get(int(host)))
    users.save(user)
    return jsonify(dict(rc=0))
示例#3
0
文件: api.py 项目: nevernet/pydelo
def api_update_host_by_id(id):
    hosts.update(hosts.get(id), **request.form.to_dict())
    return jsonify(dict(rc=0))
示例#4
0
文件: api.py 项目: nevernet/pydelo
def api_get_host_by_id(id):
    return jsonify(dict(rc=0, data=hosts.get(id)))
示例#5
0
文件: api.py 项目: zq920320/pydelo
def api_update_host_by_id(id):
    hosts.update(hosts.get(id), **request.form.to_dict())
    return jsonify(dict(rc=0))
示例#6
0
文件: api.py 项目: zq920320/pydelo
def api_get_host_by_id(id):
    return jsonify(dict(rc=0, data=hosts.get(id)))