Browse Source

Creada la tabla horas con las horas de servicio

politica
Celestino Rey 1 year ago
parent
commit
decf6fc97d
2 changed files with 4 additions and 3 deletions
  1. +1
    -1
      Padel/initdb.sh
  2. +3
    -2
      Padel/servicios/padel/reservas.py

+ 1
- 1
Padel/initdb.sh View File

@ -1 +1 @@
python -m flask --app padel init-db
python3 -m flask --app padel init-db

+ 3
- 2
Padel/servicios/padel/reservas.py View File

@ -92,6 +92,8 @@ def actualizar_reserva(id):
@bp.route("/eligedia", methods=['GET', 'POST'])
@login_required
def eligedia():
horas = [9,10,11,12,13,14,17,18,19,20,21]
hoy = date.today()
manana = hoy + timedelta(days=1)
pasado = hoy + timedelta(days=2)
@ -113,7 +115,6 @@ def eligedia():
# )
# db.commit()
try:
db.execute(
"DELETE FROM reservas WHERE fecha=?", (ayer,)
@ -139,7 +140,7 @@ def eligedia():
print("No hay horas para hoy")
db = get_db()
for hora in range(8,18):
for hora in horas:
print("hora: %02d" % hora)
db.execute(
"INSERT INTO reservas (nombre, fecha, hora) VALUES (?, ?, ?)", ("-", diaelegido, "%02d:00" % hora,),


Loading…
Cancel
Save