示例#1
0
def _run_on_start():
    Camara.connect()
示例#2
0
def index():
    return jsonify(Camara.getall())
示例#3
0
def destroy(id):
    temp = Camara.get(id)
    if not temp: abort(404)
    return Camara.remove(id)
示例#4
0
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)
示例#5
0
def store():
    data = request.get_json()
    if not request.json or not Camara.valid(data):
        abort(400)
    return Camara.add(data)
示例#6
0
def search(q):
    return jsonify(Camara.buscar(q))
示例#7
0
def show(id):
    return jsonify(Camara.get(id))