Beispiel #1
0
def listaClientesMes():
    if 'fecha' in request.form:
        fecha  = request.form['fecha']
        mes    = request.form['mes']
        anio   = request.form['anio']
        umbral = request.form['minimo']
        intervalo = request.form['intervalo']
        use_prepare = 'prepare'  in request.form
        break0 = 'break0' in request.form
        niter  = request.form['iter']
        # connect fuera para comparar tiempos con más precisión
        db_conn = database.dbConnect()
        t0=round(time.time() * 1000)
        dbr = database.getListaCliMes(db_conn, mes, anio, int(umbral), int(intervalo), use_prepare, break0, int(niter))
        t1=round(time.time() * 1000)
        database.dbCloseConnect(db_conn)

        return render_template('listaClientesMes.html',
            fecha = fecha,
            mes   = mes,
            anio  = anio,
            umbral = int(umbral),
            intervalo = int(intervalo),
            use_prepare = use_prepare,
            break0 = break0,
            tiempo = str(int(t1-t0)),
            dbr=dbr
           )
    else:
        return render_template('listaClientesMes.html')
Beispiel #2
0
def index(methods = ['POST', 'GET']):
    if request.method == 'GET':
        return render_template('index.html')

    if request.method == 'POST':
        mes = request.form.get('mes')
        anio = request.form.get('anio')
        iumbral = request.form.get('iumbral')
        iintervalo = request.form.get('iintervalo')
        use_prepare = request.form.get('use_repare')
        break0 = request.form.get('break0')
        niter = request.form.get('niter')
        results = db.getListaCliMes(int(mes), int(anio), int(iumbral), int(iintervalo), int(use_prepare), int(break0), int(niter))
        print(results)
        return render_template('lista.html', results=results)