def _run_on_start(): Camara.connect()
def index(): return jsonify(Camara.getall())
def destroy(id): temp = Camara.get(id) if not temp: abort(404) return Camara.remove(id)
def update(id): temp = Camara.get(id) data = request.get_json() if not temp or not data or not Camara.valid(data): abort(404) return Camara.update(id, data)
def store(): data = request.get_json() if not request.json or not Camara.valid(data): abort(400) return Camara.add(data)
def search(q): return jsonify(Camara.buscar(q))
def show(id): return jsonify(Camara.get(id))