Changeset 2439 for WAeUP_SRP/base/WAeUPTables.py
- Timestamp:
- 26 Oct 2007, 14:48:39 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTables.py
r2437 r2439 1341 1341 data['student_id'] = student_id 1342 1342 data['level_id'] = level_id 1343 session_id = self.getLevelSession(level.getContent(),student_id,level_id) 1344 data['session_id'] = session_id 1343 1345 #data['queue_status'] = OBJECT_CREATED 1344 1346 data['code'] = course_id … … 1380 1382 ###) 1381 1383 1382 def queue_getCourses(self,student_id,level_id): ###(1383 level_path = "%s/campus/students/%s/study_course/%s" % (self.portal_url.getPortalPath(),1384 student_id,1385 level_id)1386 # portal_catalog_query = Eq('path',level_path) &\1387 # Eq('portal_type', "StudentCourseResult")1388 # portal_catalog_results = self.portal_catalog_real.evalAdvancedQuery(portal_catalog_query)1389 portal_catalog_results = self.portal_catalog(path = level_path,1390 portal_type = "StudentCourseResult")1391 query = Eq('student_id',student_id) & Eq('level_id', level_id)1392 course_results = self.course_results.evalAdvancedQuery(query)1393 if len(course_results) != len(portal_catalog_results):1394 course_results = self.updateCourseResults(student_id,1395 level_id,1396 portal_catalog_results,1397 course_results)1398 carry_overs = []1399 normal = []1400 credits = 01401 for brain in course_results:1402 d = {}1403 credits += int(brain.credits)1404 for field in self.schema():1405 d[field] = getattr(brain,field,'')1406 d['sheduled'] = brain.queue_status == ADDING_SHEDULED1407 d['coe'] = 'Elective'1408 if brain.core_or_elective:1409 d['coe'] = 'Core'1410 id = code = d['id'] = brain.code1411 is_carry_over = False1412 if code.endswith('_co'):1413 is_carry_over = True1414 code = code[:-3]1415 d['code'] = code1416 d['title'] = self.courses_catalog.evalAdvancedQuery(Eq('code',code))[0].title1417 if is_carry_over:1418 d['coe'] = 'Core'1419 carry_overs.append(d)1420 else:1421 normal.append(d)1422 normal.sort(cmp=lambda x,y: cmp(x['semester'], y['semester']))1423 carry_overs.sort(cmp=lambda x,y: cmp(x['semester'], y['semester']))1424 return credits,carry_overs,normal1425 ###)1426 1427 1384 InitializeClass(CourseResults) 1428 1385 ###)
Note: See TracChangeset for help on using the changeset viewer.