-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdummy.py
85 lines (68 loc) · 3.06 KB
/
dummy.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
from Package import db # from __init__ import app db Object
import os
from Package.models import User, Room
if __name__ == '__main__':
# get current directory
current_dir = os.path.abspath(os.path.dirname(__file__))
# go to that directory
os.chdir(current_dir+'/Package')
# delete database and create new database
if os.path.exists("data.sqlite"):
os.remove("data.sqlite")
db.create_all()
# User parameters
name_list = ['admin','Giny','Bungy', 'Philip', 'William', 'Kishan','Eddison','Rhona',
'Yassin','Donald','Giorgia','Vivaan','Jason',
'Jazmin','Mischa','Natan','Liya','Milena',
'Kailum','Aleksander']
password_list = ['hack','hack','hack','hack','hack',
'hack','hack','hack','hack','hack',
'hack','hack','hack','hack','hack',
'hack','hack','hack','hack','hack']
# Room parameters
event_list = ["Let's enjoy in LKF Hotel","Welcome PizzaHutt Hotel","Have fun in Diseny","Swim in Ocean Park","Have a feast in KFC",
"Welcome to HALL22222","Spend a night in Conference Lodge","McDonald is your best choice","Enjoy your hamburger in Burger King", "Enjoy fresh in SUbWAY"]
date_list = ['2021-05-12','2021-04-18','2021-12-01','2031-04-23','2023-04-21',
'2023-06-01','2021-12-31','2021-05-13','2021-04-15','2021-09-01']
time_list = ['01:21','01:32','11:12','11:41','01:12',
'05:13','05:17','11:16','10:41','07:12']
location_list = ['Yuen Long','Kwun Tong','Tsuen Wan','Sai Kung','Kwai Tsing',
'Sai Kung','Kwun Tong','Yuen Long','Kwun Tong','Tsuen Wan']
pplneed_list = [5,3,7,4,6,
5,3,7,8,4]
description_list = ['Come on','Go Go Go','Hey there!','SUPER!!!','LetGo',
'SLEEP!','SLEEEEEEEP Zzzz','Come here','Go Yoloooooooo','Eaaaaatttttt',]
type_list = ['Accommodations','Accommodations','Tickets','Tickets','Cuisines',
'Accommodations','Accommodations','Cuisines','Cuisines','Cuisines']
chat_list = ['1:How are you\n1:Let us sleep',
'1:Hey there\n1:Let us gogogo',
'4:Hi\n4:Let us have fun',
'17:Yolooooo',
'1:Hey there\n1:Group togther\n1:My name is admin\n1:hehe',
'18:Yolooooo\n18:Why is it accommodation',
'1:Yo man\n1:Typing is so boring',
'18:YOHOLOLO\n18:Let us go eattttttt',
'3:End',
'2:I am admin2'
]
for index in range(20):
db.session.add(User(name_list[index],password_list[index]))
db.session.commit()
def room_input(hostname,ind):
user = User.query.filter_by(name=hostname).first()
user.rooms.append(
Room(event_list[ind],date_list[ind],time_list[ind],location_list[ind],
description_list[ind],pplneed_list[ind],type_list[ind],user.id,
chat_list[ind])
)
room_input('admin',0)
room_input('Giny',1)
room_input('Jason',2)
room_input('Giorgia',3)
room_input('Bungy',4)
room_input('Aleksander',5)
room_input('William',6)
room_input('Vivaan',7)
room_input('Kishan',8)
room_input('Philip',9)
db.session.commit()