Ignore:
Timestamp:
26 Oct 2007, 14:48:39 (17 years ago)
Author:
joachim
Message:

new versions for getLevel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTables.py

    r2437 r2439  
    13411341            data['student_id'] = student_id
    13421342            data['level_id'] = level_id
     1343            session_id = self.getLevelSession(level.getContent(),student_id,level_id)
     1344            data['session_id'] = session_id
    13431345            #data['queue_status'] = OBJECT_CREATED
    13441346            data['code'] = course_id
     
    13801382    ###)
    13811383
    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 = 0
    1401         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_SHEDULED
    1407             d['coe'] = 'Elective'
    1408             if brain.core_or_elective:
    1409                 d['coe'] = 'Core'
    1410             id = code = d['id'] = brain.code
    1411             is_carry_over = False
    1412             if code.endswith('_co'):
    1413                 is_carry_over = True
    1414                 code = code[:-3]
    1415             d['code'] = code
    1416             d['title'] = self.courses_catalog.evalAdvancedQuery(Eq('code',code))[0].title
    1417             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,normal
    1425     ###)
    1426 
    14271384InitializeClass(CourseResults)
    14281385###)
Note: See TracChangeset for help on using the changeset viewer.