-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.py
44 lines (32 loc) · 1.54 KB
/
data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
user1 = User(username="Col1ns", firstName="Taras", lastName="Vovk", email="customemail@gmail.com", password="asdf",
phoneNumber="0935215742")
audience1 = Audience(number=12)
status1 = StatusAudience(statusName="Available")
reservation1 = Reservation(idAudience=1, idUser=1, idStatus=1,
amountOfHours=4, dateTimeOfReservation="28.10.2021", dateTimeOfEndReservation="30.11.2021")
user2 = User(username="Starvars", firstName="Danylo", lastName="Sarvas", email="dsadf@gmail.com", password="pass",
phoneNumber="102")
status2 = StatusAudience(statusName="Unavailable")
reservation2 = Reservation(idAudience=1, idUser=2, idStatus=2,
amountOfHours=4, dateTimeOfReservation="28.10.2021", dateTimeOfEndReservation="30.11.2021")
user3 = User(username="hjkda", firstName="Max", lastName="Los", email="destr@gmail.com", password="1234",
phoneNumber="103")
audience2 = Audience(number=11)
reservation3 = Reservation(idAudience=2, idUser=3, idStatus=1,
amountOfHours=8, dateTimeOfReservation="26.10.2021", dateTimeOfEndReservation="27.11.2021")
with Session() as session:
session.add(user1)
session.add(audience1)
session.add(status1)
session.commit()
session.add(reservation1)
session.add(user2)
session.add(status2)
session.commit()
session.add(reservation2)
session.add(user3)
session.add(audience2)
session.commit()
session.add(reservation3)
session.commit()
print(session.query(User).all()[0])