-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodels.py
183 lines (141 loc) · 5.64 KB
/
models.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Complaints(db.Model):
__tablename__ = "COMPLAINTS"
id = db.Column(db.Integer, primary_key = True, unique = True)
citizenship = db.Column(db.Integer, nullable = False)
category = db.Column(db.String, nullable = False)
description = db.Column(db.Text, nullable = False)
def __init__(self, citizenship, category, description) -> None:
self.citizenship = citizenship
self.category = category
self.description = description
def __repr__(self) -> str:
return f"({self.id}, {self.citizenship}, {self.category}, {self.description})"
# TODO: Implement all the tables with complaint_id as Foreign Key
class Transportation(db.Model):
__tablename__ = "TRANSPORTATION"
id = db.Column(db.Integer, primary_key = True, unique = True)
citizenship = db.Column(db.Integer, nullable = False)
description = db.Column(db.Text, nullable = False)
status = db.Column(db.Integer)
# status
# 0 == "Rejected"
# 1 == "Not Approved Yes"
# 2 == "Woring on it"
# 3 == "Completed"
def __init__(self, id, citizenship, description, status = 1) -> None:
self.id = id
self.citizenship = citizenship
self.description = description
self.status = status
def __repr__(self) -> str:
return f"({self.id}, {self.citizenship}, {self.description}, {self.status})"
class Agriculture(db.Model):
__tablename__ = "AGRICULTURE"
id = db.Column(db.Integer, primary_key = True, unique = True)
citizenship = db.Column(db.Integer, nullable = False)
description = db.Column(db.Text, nullable = False)
status = db.Column(db.Integer)
# status
# 0 == "Rejected"
# 1 == "Not Approved Yes"
# 2 == "Woring on it"
# 3 == "Completed"
def __init__(self, id, citizenship, description, status = 1) -> None:
self.id = id
self.citizenship = citizenship
self.description = description
self.status = status
def __repr__(self) -> str:
return f"({self.id}, {self.citizenship}, {self.description}, {self.status})"
class DrinkingWater(db.Model):
__tablename__ = "DrinkingWater".upper()
id = db.Column(db.Integer, primary_key = True, unique = True)
citizenship = db.Column(db.Integer, nullable = False)
description = db.Column(db.Text, nullable = False)
status = db.Column(db.Integer)
# status
# 0 == "Rejected"
# 1 == "Not Approved Yes"
# 2 == "Woring on it"
# 3 == "Completed"
def __init__(self, id, citizenship, description, status = 1) -> None:
self.id = id
self.citizenship = citizenship
self.description = description
self.status = status
def __repr__(self) -> str:
return f"({self.id}, {self.citizenship}, {self.description}, {self.status})"
class Electricity(db.Model):
__tablename__ = "Electricity".upper()
id = db.Column(db.Integer, primary_key = True, unique = True)
citizenship = db.Column(db.Integer, nullable = False)
description = db.Column(db.Text, nullable = False)
status = db.Column(db.Integer)
# status
# 0 == "Rejected"
# 1 == "Not Approved Yes"
# 2 == "Woring on it"
# 3 == "Completed"
def __init__(self, id, citizenship, description, status = 1) -> None:
self.id = id
self.citizenship = citizenship
self.description = description
self.status = status
def __repr__(self) -> str:
return f"({self.id}, {self.citizenship}, {self.description}, {self.status})"
class Health(db.Model):
__tablename__ = "Health".upper()
id = db.Column(db.Integer, primary_key = True, unique = True)
citizenship = db.Column(db.Integer, nullable = False)
description = db.Column(db.Text, nullable = False)
status = db.Column(db.Integer)
# status
# 0 == "Rejected"
# 1 == "Not Approved Yes"
# 2 == "Woring on it"
# 3 == "Completed"
def __init__(self, id, citizenship, description, status = 1) -> None:
self.id = id
self.citizenship = citizenship
self.description = description
self.status = status
def __repr__(self) -> str:
return f"({self.id}, {self.citizenship}, {self.description}, {self.status})"
class Security(db.Model):
__tablename__ = "Security".upper()
id = db.Column(db.Integer, primary_key = True, unique = True)
citizenship = db.Column(db.Integer, nullable = False)
description = db.Column(db.Text, nullable = False)
status = db.Column(db.Integer)
# status
# 0 == "Rejected"
# 1 == "Not Approved Yes"
# 2 == "Woring on it"
# 3 == "Completed"
def __init__(self, id, citizenship, description, status = 1) -> None:
self.id = id
self.citizenship = citizenship
self.description = description
self.status = status
def __repr__(self) -> str:
return f"({self.id}, {self.citizenship}, {self.description}, {self.status})"
class Others(db.Model):
__tablename__ = "Others".upper()
id = db.Column(db.Integer, primary_key = True, unique = True)
citizenship = db.Column(db.Integer, nullable = False)
description = db.Column(db.Text, nullable = False)
status = db.Column(db.Integer)
# status
# 0 == "Rejected"
# 1 == "Not Approved Yes"
# 2 == "Woring on it"
# 3 == "Completed"
def __init__(self, id, citizenship, description, status = 1) -> None:
self.id = id
self.citizenship = citizenship
self.description = description
self.status = status
def __repr__(self) -> str:
return f"({self.id}, {self.citizenship}, {self.description}, {self.status})"