Пример #1
0
from flask import Flask
from flask_orator import Orator
from models.cliente import Cliente
from flask_orator import Orator, jsonify

app = Flask(__name__)
app.config['ORATOR_DATABASES'] = {
    'postgres': {
        'driver': 'postgres',
        'host': 'localhost',
        'database': 'Wassp',
        'user': '******',
        'password': '******',
        'prefix': ''
    }
}

db = Orator(app)
clnt = Cliente.find(1)
print(clnt.nombre)
Пример #2
0
def get_client(cliente_id):
    cliente = Cliente.find(cliente_id)
    return jsonify(cliente)
Пример #3
0
def get_clienteid(cliente_id):
    clnt = Cliente.find(int(cliente_id))
    return jsonify(clnt)