-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
220 lines (189 loc) · 5.62 KB
/
setup.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# Necessary set-up.
from app import db
from app.models import *
from app.utils import *
import datetime
import time
# Drop all database tables.
db.drop_all()
# Create new database tables.
db.create_all()
# Create colored pins.
cp_yellow = ColoredPin(
color_name="Yellow",
hex_color="fdd800",
pin_image_name="mbb_yellow.png"
)
db.session.add(cp_yellow)
cp_green = ColoredPin(
color_name="Green",
hex_color="009933",
pin_image_name="mbb_green.png"
)
db.session.add(cp_green)
cp_blue = ColoredPin(
color_name="Blue",
hex_color="0f85c7",
pin_image_name="mbb_blue.png"
)
db.session.add(cp_blue)
cp_red = ColoredPin(
color_name="Red",
hex_color="ef3d23",
pin_image_name="mbb_red.png"
)
db.session.add(cp_red)
cp_orange = ColoredPin(
color_name="Orange",
hex_color="f8a11d",
pin_image_name="mbb_orange.png"
)
db.session.add(cp_orange)
cp_purple = ColoredPin(
color_name="Purple",
hex_color="84459b",
pin_image_name="mbb_purple.png"
)
db.session.add(cp_purple)
cp_aqua = ColoredPin(
color_name="Aqua",
hex_color="82D1DA",
pin_image_name="mbb_aqua.png"
)
db.session.add(cp_aqua)
cp_grey = ColoredPin(
color_name="Grey",
hex_color="CCCCCC",
pin_image_name="mbb_grey.png"
)
db.session.add(cp_grey)
cp_lavender = ColoredPin(
color_name="Lavender",
hex_color="6F6AB0",
pin_image_name="mbb_lavender.png"
)
db.session.add(cp_lavender)
cp_light_green = ColoredPin(
color_name="Light Green",
hex_color="BFD849",
pin_image_name="mbb_light_green.png"
)
db.session.add(cp_light_green)
cp_magenta = ColoredPin(
color_name="Magenta",
hex_color="B86CAC",
pin_image_name="mbb_magenta.png"
)
db.session.add(cp_magenta)
cp_maroon = ColoredPin(
color_name="Maroon",
hex_color="8B181B",
pin_image_name="mbb_maroon.png"
)
db.session.add(cp_maroon)
cp_navy = ColoredPin(
color_name="Navy",
hex_color="2D4FA0",
pin_image_name="mbb_navy.png"
)
db.session.add(cp_navy)
cp_periwinkle = ColoredPin(
color_name="Periwinkle",
hex_color="A099CB",
pin_image_name="mbb_periwinkle.png"
)
db.session.add(cp_periwinkle)
cp_pink = ColoredPin(
color_name="Pink",
hex_color="F69799",
pin_image_name="mbb_pink.png"
)
db.session.add(cp_pink)
cp_sky_blue = ColoredPin(
color_name="Sky Blue",
hex_color="9FC9EB",
pin_image_name="mbb_sky_blue.png"
)
db.session.add(cp_sky_blue)
cp_turquoise = ColoredPin(
color_name="Turquoise",
hex_color="039B81",
pin_image_name="mbb_turquoise.png"
)
db.session.add(cp_turquoise)
# Create food resource types.
frt_farmers_market = FoodResourceType(
name_singular="Farmers' Market",
name_plural="Farmers' Markets",
colored_pin=cp_yellow)
frt_food_cupboard = FoodResourceType(
name_singular="Food Cupboard",
name_plural="Food Cupboards",
colored_pin=cp_green)
frt_senior_meals = FoodResourceType(
name_singular="Senior Meals",
name_plural="Senior Meals",
colored_pin=cp_blue)
frt_share_host_site = FoodResourceType(
name_singular="SHARE Host Site",
name_plural="SHARE Host Sites",
colored_pin=cp_red)
frt_soup_kitchen = FoodResourceType(
name_singular="Soup Kitchen",
name_plural="Soup Kitchens",
colored_pin=cp_orange)
frt_wic_office = FoodResourceType(
name_singular="WIC Office",
name_plural="WIC Offices",
colored_pin=cp_purple)
db.session.add(frt_farmers_market)
db.session.add(frt_food_cupboard)
db.session.add(frt_senior_meals)
db.session.add(frt_share_host_site)
db.session.add(frt_soup_kitchen)
db.session.add(frt_wic_office)
db.session.commit()
# Create 3 admin users
u1 = User(email='[email protected]', password = 'pass123', is_enabled = True,
first_name = 'Ben', last_name = 'Sandler',
roles=[Role(name = 'Admin')])
u2 = User(email = '[email protected]', password = 'p@$$w0rd', is_enabled = True,
first_name = 'Steve',
last_name = 'Smith', roles = [Role(name = 'Admin')])
u3 = User(email = '[email protected]',
password = '139rjf9i#@$#R$#!#!!!48939832984893rfcnj3@#%***^%$#@#$@#',
is_enabled = True, first_name = 'Sarah', last_name = 'Smith',
roles = [Role(name = 'Admin')])
u1.confirm_and_enable_debug()
u2.confirm_and_enable_debug()
u3.confirm_and_enable_debug()
# Add each new object to session and commit session.
db.session.add(u1)
db.session.add(u2)
db.session.add(u3)
db.session.commit()
# Create HTML objects
p1 = HTML(page = 'edit-page', value = 'Administrators will put content here.')
p2 = HTML(page = 'about-page', value = 'Administrators will put content here.')
p3 = HTML(page = 'map-announcements', value = 'Administrators will put announcements here.')
p4 = HTML(page = 'wic-info-page', value = 'Administrators will put content here.')
p5 = HTML(page = 'snap-info-page', value = 'Administrators will put content here.')
p6 = HTML(page = 'summer-info-page', value = 'Administrators will put content here.')
p7 = HTML(page = 'seniors-info-page', value = 'Administrators will put content here.')
p8 = HTML(page = 'contact-page', value = 'Administrators will put contact information here.')
p9 = HTML(page = 'farmers-info-page', value = 'Administrators will put content here.')
p10 = HTML(page = 'neighborhood-info-page', value = 'Administrators will put content here.')
p11 = HTML(page = 'share-info-page', value = 'Administrators will put content here.')
# Add each new object to session and commit session.
db.session.add(p1)
db.session.add(p2)
db.session.add(p3)
db.session.add(p4)
db.session.add(p5)
db.session.add(p6)
db.session.add(p7)
db.session.add(p8)
db.session.add(p9)
db.session.add(p10)
db.session.add(p11)
db.session.commit()