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())
def server_index(): ary = Server.all() return jsonarify(ary)
def server_index(): ary = [remove_passwords_if_ineligible(obj) for obj in Server.all()] return jsonarify(ary)