Changeset 2876


Ignore:
Timestamp:
7 Dec 2007, 13:55:43 (17 years ago)
Author:
joachim
Message:

simplyfied faster display of study_level

Location:
WAeUP_SRP/base/skins/waeup_student
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_student/getStudyCourseInfo.py

    r2855 r2876  
    1212return Info about the Students StudyCourse
    1313"""
     14import DateTime
    1415from Products.AdvancedQuery import Eq, Between, Le,In
    1516
     
    2324    def set_trace():
    2425        pass
     26import logging
     27logger = logging.getLogger('Skins.getStudyCourseInfo')
    2528
    2629request = context.REQUEST
     
    3538course  = info['doc'] = context.getContent()
    3639student_id = context.getStudentId()
    37 res = context.students_catalog(id = student_id)
    38 if not res:
     40student_record = context.students_catalog.getRecordByKey(student_id)
     41if not student_record:
    3942    return None
    40 sbrain = res[0]
    41 info['student'] = sbrain
    42 cert_id = sbrain.course
    43 res = context.portal_catalog_real.evalAdvancedQuery(Eq('id', cert_id) &
    44                                                     Eq('portal_type', "Certificate"))
     43info['student'] = student_record
     44cert_id = student_record.course
     45# logger.info("before search")
     46# starttime = DateTime.DateTime().timeTime()
     47# res = context.portal_catalog_real.evalAdvancedQuery(Eq('id', cert_id)) # &
     48#                                                    Eq('portal_type', "Certificate"))
     49# logger.info("searchtime %f" % (DateTime.DateTime().timeTime() - starttime))
     50# if True:
     51#     #info['cert_id'] = cert_id
     52#     # brain = res[0]
     53#     # ci['title'] = brain.Title
     54#     # pl = brain.getPath().split('/')
     55#     # ci['faculty'] = pl[-4]
     56#     # ci['department'] = pl[-3]
     57#     ci['study_course'] = student_record.course
     58#     ci['faculty'] = student_record.faculty
     59#     ci['department'] = student_record.department
     60#     info['course_doc'] = ci
     61# else:
     62#     info['cert_id'] = 'N/A'
     63#     ci['study_course'] = 'N/A'
     64#     ci['title'] = 'N/A'
     65#     ci['faculty'] = 'N/A'
     66#     ci['department'] = 'N/A'
     67#     info['course_doc'] = ci
    4568ci = {}
    46 if res:
    47     info['cert_id'] = cert_id
    48     brain = res[0]
    49     ci['study_course'] = brain.getId
    50     ci['title'] = brain.Title
    51     pl = brain.getPath().split('/')
    52     ci['faculty'] = pl[-4]
    53     ci['department'] = pl[-3]
    54     info['course_doc'] = ci
    55 else:
    56     info['cert_id'] = 'N/A'
    57     ci['study_course'] = 'N/A'
    58     ci['title'] = 'N/A'
    59     ci['faculty'] = 'N/A'
    60     ci['department'] = 'N/A'
    61     info['course_doc'] = ci
     69ci['study_course'] = student_record.course
     70ci['faculty'] = student_record.faculty
     71ci['department'] = student_record.department
     72info['course_doc'] = ci
    6273
    6374items = []
     
    8293
    8394
    84 current_level = sbrain.level
     95current_level = student_record.level
    8596levels = context.objectIds()
    8697review_state = wftool.getInfoFor(context,'review_state',None)
    87 student_review_state = sbrain.review_state
     98student_review_state = student_record.review_state
    8899#if review_state != 'content_addable' and student_review_state == 'school_fee_paid': #and context.isStudent():
    89100#    wftool.doActionFor(context,'close_for_edit')
     
    95106               (previous_verdict in ('A','B','C','F','J','L','M') or\
    96107               current_level == '100' or\
    97                (sbrain.mode.startswith('de') and current_level == '200'))
     108               (student_record.mode.startswith('de') and current_level == '200'))
    98109
    99110missing_data = has_paid and\
    100111               current_level not in levels and\
    101                not (previous_verdict or sbrain.level) and\
     112               not (previous_verdict or student_record.level) and\
    102113               not (current_level == '100' or\
    103                (sbrain.mode.startswith('de') and current_level == '200'))
     114               (student_record.mode.startswith('de') and current_level == '200'))
    104115
    105116info['missing_data'] = missing_data
  • WAeUP_SRP/base/skins/waeup_student/study_course_view.pt

    r2678 r2876  
    4545        <td><span tal:content="info/previous_verdict" /></td>
    4646      </tr>     
     47      <span tal:define="f_id sc/faculty;
     48        d_id sc/department;
     49        c_id sc/study_course;
     50        f_title context/academics/?f_id/Title|string:Faculty not yet in Prospectus;
     51        d_title context/academics/?f_id/?d_id/Title|string:Department not yet in Prospectus;
     52        c_title context/academics/?f_id/?d_id/certificates/?c_id/Title|string:Department not yet in Prospectus"
     53        >
    4754      <tr>
    4855        <td width="220px">Certificate:</td>
    49         <td><span tal:content="sc/title" /></td>
     56        <td tal:content="c_title" />
    5057      </tr>
    5158      <tr>
    5259        <td>Certificate Id:</td>
    53         <td tal:content="sc/study_course" />
     60        <td><span tal:content="sc/study_course" /></td>
    5461      </tr>
    55         <span tal:define="f_id sc/faculty;
    56         d_id sc/department;
    57         f_title context/academics/?f_id/Title|string:Faculty not yet in Prospectus;
    58         d_title context/academics/?f_id/?d_id/Title|string:Department not yet in Prospectus"
    59         >
    6062          <tr>
    6163            <td>Faculty:</td>
Note: See TracChangeset for help on using the changeset viewer.