예제 #1
0
def server_create():
    obj = Server()
    obj.mass_assign(request.json)
    if not obj.is_valid:
        return jsonify(errors=obj.validation_errors), 422
    db.session.add(obj)
    db.session.commit()
    return jsonify(**obj.to_dict())
예제 #2
0
파일: api.py 프로젝트: PowerDNS/pdnscontrol
def server_create():
    obj = Server()
    obj.mass_assign(request.json)
    if not obj.is_valid:
        return jsonify(errors=obj.validation_errors), 422
    db.session.add(obj)
    db.session.commit()
    return jsonify(**obj.to_dict())
예제 #3
0
def server_index():
    ary = Server.all()
    return jsonarify(ary)
예제 #4
0
파일: api.py 프로젝트: zeha/pdnscontrol
def server_index():
    ary = Server.all()
    return jsonarify(ary)
예제 #5
0
def server_index():
    ary = [remove_passwords_if_ineligible(obj) for obj in Server.all()]
    return jsonarify(ary)
예제 #6
0
파일: api.py 프로젝트: PowerDNS/pdnscontrol
def server_index():
    ary = [remove_passwords_if_ineligible(obj) for obj in Server.all()]
    return jsonarify(ary)