Ejemplo n.º 1
0
def _run_on_start():
    Lugar.connect()
Ejemplo n.º 2
0
def index():
    return jsonify(Lugar.getall())
Ejemplo n.º 3
0
def destroy(id):
    temp = Lugar.get(id)
    if not temp: abort(404)
    return Lugar.remove(id)
Ejemplo n.º 4
0
def update(id):
    temp = Lugar.get(id)
    data = request.get_json()
    if not temp or not data or not Lugar.valid(data):
        abort(404)
    return Lugar.update(id, data)
Ejemplo n.º 5
0
def store():
    data = request.get_json()
    if not request.json or not Lugar.valid(data):
        abort(400)
    return Lugar.add(data)
Ejemplo n.º 6
0
def search(q):
    return jsonify(Lugar.buscar(q))
Ejemplo n.º 7
0
def show(id):
     return jsonify(Lugar.get(id))