-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseed.py
More file actions
133 lines (114 loc) · 3.14 KB
/
seed.py
File metadata and controls
133 lines (114 loc) · 3.14 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
from src.models.admin_model import Admin
from src.models.staff_model import Staff
from src.database.auth_db import create_admin, create_staff
from src.database.incident_db import create_incident
from src.models.incidents_model import Incidents
#### Creating 2 Station admins
PASSWORD = "123456aA"
admin1 = Admin(
password=PASSWORD,
station_name="Andheri",
role="STATION_ADMIN",
admin_name="Ravi"
)
admin2 = Admin(
password=PASSWORD,
station_name="Bandra",
role="STATION_ADMIN",
admin_name="kishore"
)
create_admin(admin1)
create_admin(admin2)
#### Creating 2 Dept admins for 2 different departments (Maintenance and Security) for each station
dept1 = Admin(
password=PASSWORD,
station_name="Andheri",
role="DEPT_ADMIN",
dept_name="Maintenance",
admin_name="Sameer"
)
dept2 = Admin(
password=PASSWORD,
station_name="Andheri",
role="DEPT_ADMIN",
dept_name="Security",
admin_name="Saurabh"
)
dept3 = Admin(
password=PASSWORD,
station_name="Bandra",
role="DEPT_ADMIN",
dept_name="Maintenance",
admin_name="Rajesh"
)
dept4 = Admin(
password=PASSWORD,
station_name="Bandra",
role="DEPT_ADMIN",
dept_name="Security",
admin_name="Brigesh"
)
create_admin(dept1)
create_admin(dept2)
create_admin(dept3)
create_admin(dept4)
#### Creating 10 staffs for each department of each station with half status as AVAILABLE and half as ASSIGNED
for i in range(10):
staff1 = Staff(
password=PASSWORD,
station_name="Andheri",
dept_name="Maintenance",
staff_name="Staff"+str(i),
status="Available" if i%2==0 else "Assigned",
phone="912345678"+str(i)
)
staff2 = Staff(
password=PASSWORD,
station_name="Andheri",
dept_name="Security",
staff_name="Staff"+str(i),
status="Available" if i%2==0 else "Assigned",
phone="912345673"+str(i)
)
staff3 = Staff(
password=PASSWORD,
station_name="Bandra",
dept_name="Maintenance",
staff_name="Staff"+str(i),
status="Available" if i%2==0 else "Assigned",
phone="912345674"+str(i)
)
staff4 = Staff(
password=PASSWORD,
station_name="Bandra",
dept_name="Security",
staff_name="Staff"+str(i),
status="Available" if i%2==0 else "Assigned",
phone="912345676"+str(i)
)
create_staff(staff1)
create_staff(staff2)
create_staff(staff3)
create_staff(staff4)
#### Creating 10 incidents for each station
#crime, violence, stampede, cleanliness, safety threat
type = ["Crime","Violence","Stampede","Cleanliness","Safety Threat"]
for i in range(10):
incident1 = Incidents(
title="IncidentA"+str(i),
description="Incident"+str(i),
type=type[i%5],
station_name="Andheri",
location="Platform no. 1",
source="CCTV"
)
incident2 = Incidents(
title="IncidentB"+str(i),
description="Incident"+str(i),
type=type[i%5],
station_name="Bandra",
location="Platform no. 1",
source="CCTV"
)
create_incident(incident1)
create_incident(incident2)