Example #1
0
def update(id):
    temp = Matricula.get(id)
    data = request.get_json()
    if not temp or not data or not Matricula.valid(data):
        abort(404)
    result = Matricula.update(id, data)
    return jsonify({'result': result }), 201
Example #2
0
def index():
    return jsonify(Matricula.getall())
Example #3
0
def _run_on_start():
    Matricula.connect()
Example #4
0
def destroy(id):
    temp = Matricula.get(id)
    if not temp: abort(404)
    result = Matricula.remove(id)
    return jsonify({'result': result }), 201
Example #5
0
def store():
    data = request.get_json()
    if not request.json or not Matricula.valid(data):
        abort(400)
    result = Matricula.add(data)
    return jsonify({'result': result}), 201
Example #6
0
def propietario(id):
     return jsonify(Matricula.getPropietario(id))
Example #7
0
def search(q):
    return jsonify(Matricula.buscar(q))
Example #8
0
def show(id):
     return jsonify(Matricula.get(id))