|
49 | 49 | ) |
50 | 50 |
|
51 | 51 | for row_tuple in rpi_schools_rows: |
52 | | - row = RPISchools(name=row_tuple[0], description=row_tuple[1]) |
| 52 | + row = RPISchools() |
| 53 | + row.name = row_tuple[0] |
| 54 | + row.description = row_tuple[1] |
| 55 | + |
53 | 56 | db.session.add(row) |
54 | 57 | db.session.commit() |
55 | 58 |
|
|
78 | 81 | ) |
79 | 82 |
|
80 | 83 | for row_tuple in rpi_departments_rows: |
81 | | - row = RPIDepartments( |
82 | | - name=row_tuple[0], |
83 | | - description=row_tuple[1], |
84 | | - school_id=row_tuple[2], |
85 | | - id=row_tuple[3], |
86 | | - image="https://cdn-icons-png.flaticon.com/512/5310/5310672.png", |
87 | | - website="https://www.rpi.edu", |
88 | | - ) |
| 84 | + row = RPIDepartments() |
| 85 | + row.name = row_tuple[0] |
| 86 | + row.description = row_tuple[1] |
| 87 | + row.school_id = row_tuple[2] |
| 88 | + row.id = row_tuple[3] |
| 89 | + row.image = "https://cdn-icons-png.flaticon.com/512/5310/5310672.png" |
| 90 | + row.website = "https://www.rpi.edu" |
| 91 | + |
89 | 92 | db.session.add(row) |
90 | 93 | db.session.commit() |
91 | 94 |
|
92 | 95 | class_years_rows = (2025, 2026, 2027, 2028, 2029, 2030, 2031) |
93 | 96 |
|
94 | 97 | for row_item in class_years_rows: |
95 | | - row = ClassYears(class_year=row_item, active=True) |
| 98 | + row = ClassYears() |
| 99 | + row.class_year = row_item |
| 100 | + row.active = True |
| 101 | + |
96 | 102 | db.session.add(row) |
97 | 103 | db.session.commit() |
98 | 104 |
|
|
132 | 138 | "https://rafaelcenzano.com", |
133 | 139 | ) |
134 | 140 |
|
135 | | - lab_manager = LabManager(department_id=raf_test_user[5]) |
| 141 | + lab_manager = LabManager() |
| 142 | + lab_manager.department_id = raf_test_user[5] |
136 | 143 |
|
137 | 144 | db.session.add(lab_manager) |
138 | 145 | db.session.commit() |
139 | 146 |
|
140 | | - user = User( |
141 | | - id=raf_test_user[0], |
142 | | - email=raf_test_user[0] + "@rpi.edu", |
143 | | - first_name=raf_test_user[1], |
144 | | - last_name=raf_test_user[2], |
145 | | - preferred_name=raf_test_user[3], |
146 | | - class_year=raf_test_user[4], |
147 | | - lab_manager_id=lab_manager.id, |
148 | | - description=raf_test_user[6], |
149 | | - profile_picture=raf_test_user[7], |
150 | | - website=raf_test_user[8], |
151 | | - ) |
| 147 | + user = User() |
| 148 | + user.id = raf_test_user[0] |
| 149 | + user.email = raf_test_user[0] + "@rpi.edu" |
| 150 | + user.first_name = raf_test_user[1] |
| 151 | + user.last_name = raf_test_user[2] |
| 152 | + user.preferred_name = raf_test_user[3] |
| 153 | + user.class_year = raf_test_user[4] |
| 154 | + user.lab_manager_id = lab_manager.id |
| 155 | + user.description = raf_test_user[6] |
| 156 | + user.profile_picture = raf_test_user[7] |
| 157 | + user.website = raf_test_user[8] |
152 | 158 |
|
153 | 159 | db.session.add(user) |
154 | 160 | db.session.commit() |
155 | 161 |
|
156 | 162 | for row_tuple in lab_manager_rows: |
157 | | - lab_manager = LabManager(department_id=row_tuple[3]) |
| 163 | + lab_manager = LabManager() |
| 164 | + lab_manager.department_id = row_tuple[3] |
158 | 165 |
|
159 | 166 | db.session.add(lab_manager) |
160 | 167 | db.session.commit() |
161 | 168 |
|
162 | | - user = User( |
163 | | - id=row_tuple[0], |
164 | | - email=row_tuple[0] + "@rpi.edu", |
165 | | - first_name=row_tuple[1], |
166 | | - last_name=row_tuple[2], |
167 | | - lab_manager_id=lab_manager.id, |
168 | | - description=row_tuple[4], |
169 | | - profile_picture="https://www.svgrepo.com/show/206842/professor.svg", |
170 | | - ) |
| 169 | + user = User() |
| 170 | + user.id = row_tuple[0] |
| 171 | + user.email = row_tuple[0] + "@rpi.edu" |
| 172 | + user.first_name = row_tuple[1] |
| 173 | + user.last_name = row_tuple[2] |
| 174 | + user.lab_manager_id = lab_manager.id |
| 175 | + user.description = row_tuple[4] |
| 176 | + user.profile_picture = "https://www.svgrepo.com/show/206842/professor.svg" |
| 177 | + |
171 | 178 | db.session.add(user) |
172 | 179 | db.session.commit() |
173 | 180 |
|
|
255 | 262 | ) |
256 | 263 |
|
257 | 264 | for row_tuple in opportunities_rows: |
258 | | - row = Opportunities( |
259 | | - name=row_tuple[0], |
260 | | - description=row_tuple[1], |
261 | | - recommended_experience=row_tuple[2], |
262 | | - pay=row_tuple[3], |
263 | | - one_credit=row_tuple[4], |
264 | | - two_credits=row_tuple[5], |
265 | | - three_credits=row_tuple[6], |
266 | | - four_credits=row_tuple[7], |
267 | | - semester=row_tuple[8], |
268 | | - year=row_tuple[9], |
269 | | - application_due=row_tuple[10], |
270 | | - active=row_tuple[11], |
271 | | - last_updated=row_tuple[12], |
272 | | - location=row_tuple[13], |
273 | | - ) |
| 265 | + row = Opportunities() |
| 266 | + row.name = row_tuple[0] |
| 267 | + row.description = row_tuple[1] |
| 268 | + row.recommended_experience = row_tuple[2] |
| 269 | + row.pay = row_tuple[3] |
| 270 | + row.one_credit = row_tuple[4] |
| 271 | + row.two_credits = row_tuple[5] |
| 272 | + row.three_credits = row_tuple[6] |
| 273 | + row.four_credits = row_tuple[7] |
| 274 | + row.semester = row_tuple[8] |
| 275 | + row.year = row_tuple[9] |
| 276 | + row.application_due = row_tuple[10] |
| 277 | + row.active = row_tuple[11] |
| 278 | + row.last_updated = row_tuple[12] |
| 279 | + row.location = row_tuple[13] |
| 280 | + |
274 | 281 | db.session.add(row) |
275 | 282 | db.session.commit() |
276 | 283 |
|
|
282 | 289 | ) |
283 | 290 |
|
284 | 291 | for row_tuple in courses_rows: |
285 | | - row = Courses(code=row_tuple[0], name=row_tuple[1]) |
| 292 | + row = Courses() |
| 293 | + row.code = row_tuple[0] |
| 294 | + row.name = row_tuple[1] |
| 295 | + |
286 | 296 | db.session.add(row) |
287 | 297 | db.session.commit() |
288 | 298 |
|
|
296 | 306 | ) |
297 | 307 |
|
298 | 308 | for row_tuple in majors_rows: |
299 | | - row = Majors(code=row_tuple[0], name=row_tuple[1]) |
| 309 | + row = Majors() |
| 310 | + row.code = row_tuple[0] |
| 311 | + row.name = row_tuple[1] |
| 312 | + |
300 | 313 | db.session.add(row) |
301 | 314 | db.session.commit() |
302 | 315 |
|
|
313 | 326 | ) |
314 | 327 |
|
315 | 328 | for r in leads_rows: |
316 | | - row = Leads(lab_manager_id=r[0], opportunity_id=r[1]) |
| 329 | + row = Leads() |
| 330 | + row.lab_manager_id = r[0] |
| 331 | + row.opportunity_id = r[1] |
| 332 | + |
317 | 333 | db.session.add(row) |
318 | 334 | db.session.commit() |
319 | 335 |
|
320 | 336 | recommends_courses_rows = ((1, "CSCI4430"), (1, "CSCI2961"), (2, "CSCI4390")) |
321 | 337 |
|
322 | 338 | for r in recommends_courses_rows: |
323 | | - row = RecommendsCourses(opportunity_id=r[0], course_code=r[1]) |
| 339 | + row = RecommendsCourses() |
| 340 | + row.opportunity_id = r[0] |
| 341 | + row.course_code = r[1] |
| 342 | + |
324 | 343 | db.session.add(row) |
325 | 344 | db.session.commit() |
326 | 345 |
|
327 | 346 | recommends_majors_rows = ((1, "CSCI"), (1, "PHYS"), (2, "BIOL")) |
328 | 347 |
|
329 | 348 | for r in recommends_majors_rows: |
330 | | - row = RecommendsMajors(opportunity_id=r[0], major_code=r[1]) |
| 349 | + row = RecommendsMajors() |
| 350 | + row.opportunity_id = r[0] |
| 351 | + row.major_code = r[1] |
| 352 | + |
331 | 353 | db.session.add(row) |
332 | 354 | db.session.commit() |
333 | 355 |
|
334 | 356 | recommends_class_years_rows = ((3, 2025), (2, 2025), (2, 2026), (1, 2027)) |
335 | 357 |
|
336 | 358 | for r in recommends_class_years_rows: |
337 | | - row = RecommendsClassYears(opportunity_id=r[0], class_year=r[1]) |
| 359 | + row = RecommendsClassYears() |
| 360 | + row.opportunity_id = r[0] |
| 361 | + row.class_year = r[1] |
| 362 | + |
338 | 363 | db.session.add(row) |
339 | 364 | db.session.commit() |
340 | 365 |
|
|
345 | 370 | ) |
346 | 371 |
|
347 | 372 | for r in user_majors: |
348 | | - major = UserMajors(user_id=r[0], major_code=r[1]) |
349 | | - department = UserDepartments(user_id=r[0], department_id=r[1]) |
350 | | - db.session.add(major) |
351 | | - db.session.add(department) |
| 373 | + row = UserMajors() |
| 374 | + row.user_id = r[0] |
| 375 | + row.major_code = r[1] |
| 376 | + |
| 377 | + db.session.add(row) |
| 378 | + db.session.commit() |
| 379 | + |
| 380 | + for r in user_majors: |
| 381 | + row = UserDepartments() |
| 382 | + row.user_id = r[0] |
| 383 | + row.department_id = r[1] |
| 384 | + |
| 385 | + db.session.add(row) |
352 | 386 | db.session.commit() |
353 | 387 |
|
354 | 388 | user_courses = ( |
|
358 | 392 | ) |
359 | 393 |
|
360 | 394 | for r in user_courses: |
361 | | - row = UserCourses(user_id=r[0], course_code=r[1], in_progress=r[2]) |
| 395 | + row = UserCourses() |
| 396 | + row.user_id = r[0] |
| 397 | + row.course_code = r[1] |
| 398 | + row.in_progress = r[2] |
| 399 | + |
362 | 400 | db.session.add(row) |
363 | 401 | db.session.commit() |
364 | 402 |
|
|
370 | 408 | ) |
371 | 409 |
|
372 | 410 | for r in participates_rows: |
373 | | - row = Participates(user_id=r[0], opportunity_id=r[1]) |
| 411 | + row = Participates() |
| 412 | + row.user_id = r[0] |
| 413 | + row.opportunity_id = r[1] |
| 414 | + |
374 | 415 | db.session.add(row) |
375 | 416 | db.session.commit() |
376 | 417 |
|
|
0 commit comments