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
def index(): return jsonify(Matricula.getall())
def _run_on_start(): Matricula.connect()
def destroy(id): temp = Matricula.get(id) if not temp: abort(404) result = Matricula.remove(id) return jsonify({'result': result }), 201
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
def propietario(id): return jsonify(Matricula.getPropietario(id))
def search(q): return jsonify(Matricula.buscar(q))
def show(id): return jsonify(Matricula.get(id))