Changeset 2253 for WAeUP_SRP/base/skins


Ignore:
Timestamp:
17 Sep 2007, 11:14:24 (17 years ago)
Author:
Henrik Bettermann
Message:

dont't search twice for certificate levels

Location:
WAeUP_SRP/base/skins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_layout/layout_search_edit.pt

    r2243 r2253  
    77             faculties options/faculties|nothing;
    88             departments options/departments|nothing;
     9             certificate_levels options/certificate_levels|nothing;
    910             "
    1011             >
     
    1718    <input type="hidden" name="departments" tal:condition="departments"
    1819           tal:attributes="value departments">
     20    <input type="hidden" name="certificate_levels" tal:condition="certificate_levels"
     21           tal:attributes="value certificate_levels">           
    1922    <div class=''>
    2023      <div class='documentFields'>
  • WAeUP_SRP/base/skins/waeup_student/search_students.py

    r2250 r2253  
    6464faculties =  fget('faculties')
    6565departments = fget('departments')
    66 certificate_level = fget('certificate_level')
    67 dep_str = fac_str = certificate_level_str = ''
     66certificate_levels = fget('certificate_levels')
     67dep_str = fac_str = certificate_levels_str = ''
    6868
    6969if "ClearanceOfficers" in member.getGroups():
     
    101101    only_review = False
    102102    ca_view = True
    103     if certificate_level:
     103    if certificate_levels:
    104104        #from Products.zdb import set_trace;set_trace()
    105         certificate_level_str = certificate_level
    106         certificate_level = certificate_level.split()
     105        certificate_levels_str = certificate_levels
     106        certificate_levels = certificate_levels.split()
    107107    else:
    108108        query = In('portal_type',('StudyLevel',)) &\
    109109                 In('localUsersWithRoles', ("user:%s" % member,))
    110110        res = aq_portal(query)
    111        
     111
    112112        logger.info('CourseAdviser %s initiated student_search' % member)
    113         certificate_level = []
    114         if res:
    115             certificate_level = ['/'.join(f.getPath().split('/')[-2:]) for f in res]
    116         user_info['certificate_level'] = certificate_level
    117         certificate_level_str = " ".join(certificate_level)
    118        
     113        certificate_levels = []
     114        if res:
     115            certificate_levels = ['/'.join(f.getPath().split('/')[-2:]) for f in res]
     116        user_info['certificate_levels'] = certificate_levels
     117        certificate_levels_str = " ".join(certificate_levels)
     118
    119119default = {'search_mode': 'student_id',
    120120        'review_state': state,
     
    130130                      faculties = fac_str,
    131131                      departments = dep_str,
    132                       certificate_level = certificate_level_str,
     132                      certificate_levels = certificate_levels_str,
    133133                      commit = False,
    134134                      )
     
    212212    review_res = aq_students(query)
    213213    logger.info('%s searches for students in review_state %s' % (member,state))
    214    
     214
    215215if co_view:
    216216    only_review = False
     
    222222    only_review = False
    223223    with_review = True
    224     courses = [cl.split('/')[0] for cl in certificate_level]
    225     levels = [cl.split('/')[1] for cl in certificate_level]
     224    courses = [cl.split('/')[0] for cl in certificate_levels]
     225    levels = [cl.split('/')[1] for cl in certificate_levels]
    226226    query = In('course',courses) & In('level',levels)
    227227    res = aq_students(query)
     
    230230    review_set = [r.id for r in review_res]
    231231
    232 #from Products.zdb import set_trace;set_trace() 
     232#from Products.zdb import set_trace;set_trace()
    233233
    234234if only_review:
     
    241241else:
    242242    all = search_set
    243    
     243
    244244items = all[:500]
    245245students = []
Note: See TracChangeset for help on using the changeset viewer.