Beispiel #1
0
def add_booking():
    booking = Booking()
    booking.client_name = request.form['name']
    booking.client_phone = request.form['phone']
    booking.created_at = datetime.datetime.now()
    booking.time_to = datetime.datetime.now() + datetime.timedelta(hours=2)
    booking.closed = False
    booking.barbershop_id = request.form['bbShop']
    db_session.add(booking)
    db_session.commit()
    return 'ok'
Beispiel #2
0
barbershops[1].longitude = 55.9536999
barbershops[2].latitude = 54.7257102
barbershops[2].longitude = 55.9458011
barbershops[3].latitude = 54.7219511
barbershops[3].longitude = 55.9396386

db_session.commit()

import datetime

booking = Booking()
booking.barbershop_id = 1
booking.created_at = datetime.datetime.now()
booking.time_to = datetime.datetime.now() + datetime.timedelta(days=1)
booking.client_name = 'Владимир'
booking.client_phone = '+7 937 306 76 19'
booking.closed = True
db_session.add(booking)

booking = Booking()
booking.barbershop_id = 1
booking.created_at = datetime.datetime.now()
booking.time_to = datetime.datetime.now() + datetime.timedelta(hours=20)
booking.client_name = 'Ильяс'
booking.client_phone = '+7 937 306 76 19'
booking.closed = True
db_session.add(booking)

booking = Booking()
booking.barbershop_id = 1
booking.created_at = datetime.datetime.now()