-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstarter_plan.py
222 lines (202 loc) · 11.1 KB
/
starter_plan.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
221
222
from models import db, Week, Day, User
from flask import session
def setup_starter_plan():
user_id = session['user_id']
user = User.query.get(user_id)
user.num_weeks = 16;
week1 = Week(num = 1, mileage_target = 19, user = user.id)
week2 = Week(num = 2, mileage_target = 21, user = user.id)
week3 = Week(num = 3, mileage_target = 25, user = user.id)
week4 = Week(num = 4, mileage_target = 23, user = user.id)
week5 = Week(num = 5, mileage_target = 30, user = user.id)
week6 = Week(num = 6, mileage_target = 32, user = user.id)
week7 = Week(num = 7, mileage_target = 28, user = user.id)
week8 = Week(num = 8, mileage_target = 35, user = user.id)
week9 = Week(num = 9, mileage_target = 39, user = user.id)
week10 = Week(num = 10, mileage_target = 35, user = user.id)
week11 = Week(num = 11, mileage_target = 41, user = user.id)
week12 = Week(num = 12, mileage_target = 31, user = user.id)
week13 = Week(num = 13, mileage_target = 42, user = user.id)
week14 = Week(num = 14, mileage_target = 30, user = user.id)
week15 = Week(num = 15, mileage_target = 23, user = user.id)
week16 = Week(num = 16, mileage_target = 34, user = user.id)
weeks = (week1, week2, week3, week4, week5, week6, week7, week8, week9, week10, week11, week12, week13, week14, week15, week16)
for week in weeks:
db.session.add(week)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week1.id, user=user.id)
day2 = Day(num=2, mileage_target=3, week=week1.id, user=user.id)
day3 = Day(num=3, mileage_target=4, week=week1.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week1.id, user=user.id)
day5 = Day(num=5, mileage_target=4, week=week1.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week1.id, user=user.id)
day7 = Day(num=7, mileage_target=8, week=week1.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week2.id, user=user.id)
day2 = Day(num=2, mileage_target=3, week=week2.id, user=user.id)
day3 = Day(num=3, mileage_target=4, week=week2.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week2.id, user=user.id)
day5 = Day(num=5, mileage_target=4, week=week2.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week2.id, user=user.id)
day7 = Day(num=7, mileage_target=10, week=week2.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week3.id, user=user.id)
day2 = Day(num=2, mileage_target=4, week=week3.id, user=user.id)
day3 = Day(num=3, mileage_target=5, week=week3.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week3.id, user=user.id)
day5 = Day(num=5, mileage_target=5, week=week3.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week3.id, user=user.id)
day7 = Day(num=7, mileage_target=11, week=week3.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week4.id, user=user.id)
day2 = Day(num=2, mileage_target=4, week=week4.id, user=user.id)
day3 = Day(num=3, mileage_target=5, week=week4.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week4.id, user=user.id)
day5 = Day(num=5, mileage_target=5, week=week4.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week4.id, user=user.id)
day7 = Day(num=7, mileage_target=9, week=week4.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week5.id, user=user.id)
day2 = Day(num=2, mileage_target=5, week=week5.id, user=user.id)
day3 = Day(num=3, mileage_target=6, week=week5.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week5.id, user=user.id)
day5 = Day(num=5, mileage_target=6, week=week5.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week5.id, user=user.id)
day7 = Day(num=7, mileage_target=13, week=week5.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week6.id, user=user.id)
day2 = Day(num=2, mileage_target=5, week=week6.id, user=user.id)
day3 = Day(num=3, mileage_target=6, week=week6.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week6.id, user=user.id)
day5 = Day(num=5, mileage_target=6, week=week6.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week6.id, user=user.id)
day7 = Day(num=7, mileage_target=15, week=week6.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week7.id, user=user.id)
day2 = Day(num=2, mileage_target=5, week=week7.id, user=user.id)
day3 = Day(num=3, mileage_target=7, week=week7.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week7.id, user=user.id)
day5 = Day(num=5, mileage_target=6, week=week7.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week7.id, user=user.id)
day7 = Day(num=7, mileage_target=10, week=week7.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week8.id, user=user.id)
day2 = Day(num=2, mileage_target=5, week=week8.id, user=user.id)
day3 = Day(num=3, mileage_target=7, week=week8.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week8.id, user=user.id)
day5 = Day(num=5, mileage_target=7, week=week8.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week8.id, user=user.id)
day7 = Day(num=7, mileage_target=16, week=week8.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week9.id, user=user.id)
day2 = Day(num=2, mileage_target=6, week=week9.id, user=user.id)
day3 = Day(num=3, mileage_target=8, week=week9.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week9.id, user=user.id)
day5 = Day(num=5, mileage_target=7, week=week9.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week9.id, user=user.id)
day7 = Day(num=7, mileage_target=18, week=week9.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week10.id, user=user.id)
day2 = Day(num=2, mileage_target=6, week=week10.id, user=user.id)
day3 = Day(num=3, mileage_target=8, week=week10.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week10.id, user=user.id)
day5 = Day(num=5, mileage_target=7, week=week10.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week10.id, user=user.id)
day7 = Day(num=7, mileage_target=14, week=week10.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week11.id, user=user.id)
day2 = Day(num=2, mileage_target=6, week=week11.id, user=user.id)
day3 = Day(num=3, mileage_target=8, week=week11.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week11.id, user=user.id)
day5 = Day(num=5, mileage_target=8, week=week11.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week11.id, user=user.id)
day7 = Day(num=7, mileage_target=19, week=week11.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week12.id, user=user.id)
day2 = Day(num=2, mileage_target=6, week=week12.id, user=user.id)
day3 = Day(num=3, mileage_target=6, week=week12.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week12.id, user=user.id)
day5 = Day(num=5, mileage_target=6, week=week12.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week12.id, user=user.id)
day7 = Day(num=7, mileage_target=13, week=week12.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week13.id, user=user.id)
day2 = Day(num=2, mileage_target=6, week=week13.id, user=user.id)
day3 = Day(num=3, mileage_target=8, week=week13.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week13.id, user=user.id)
day5 = Day(num=5, mileage_target=8, week=week13.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week13.id, user=user.id)
day7 = Day(num=7, mileage_target=20, week=week13.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week14.id, user=user.id)
day2 = Day(num=2, mileage_target=6, week=week14.id, user=user.id)
day3 = Day(num=3, mileage_target=6, week=week14.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week14.id, user=user.id)
day5 = Day(num=5, mileage_target=6, week=week14.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week14.id, user=user.id)
day7 = Day(num=7, mileage_target=12, week=week14.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week15.id, user=user.id)
day2 = Day(num=2, mileage_target=6, week=week15.id, user=user.id)
day3 = Day(num=3, mileage_target=5, week=week15.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week15.id, user=user.id)
day5 = Day(num=5, mileage_target=4, week=week15.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week15.id, user=user.id)
day7 = Day(num=7, mileage_target=8, week=week15.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()
day1 = Day(num=1, mileage_target=0, week=week16.id, user=user.id)
day2 = Day(num=2, mileage_target=3, week=week16.id, user=user.id)
day3 = Day(num=3, mileage_target=3, week=week16.id, user=user.id)
day4 = Day(num=4, mileage_target=0, week=week16.id, user=user.id)
day5 = Day(num=5, mileage_target=2, week=week16.id, user=user.id)
day6 = Day(num=6, mileage_target=0, week=week16.id, user=user.id)
day7 = Day(num=7, mileage_target=26.2, week=week16.id, user=user.id)
days = (day1, day2, day3, day4, day5, day6, day7)
for day in days:
db.session.add(day)
db.session.commit()