Changeset 1034 for WAeUP_SRP/trunk


Ignore:
Timestamp:
12 Dec 2006, 12:33:53 (18 years ago)
Author:
joachim
Message:

fixed some bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/search_students.py

    r1033 r1034  
    5757        'search_string': ''
    5858        }
    59 #from Products.zdb import set_trace
    60 #set_trace()
    6159rend,psm,ds = lt.renderLayout(layout_id= 'student_search',
    6260                      schema_id= 'student_search',
     
    7573                             allowed = True,
    7674                             )
    77 #set_trace()
    7875what = ds.get('search_mode')
    7976state = ds.get('review_state')
     
    103100review_res = None
    104101query = None
     102review_set = []
    105103if len(term) > 0:
    106104    if what == "student_id":
     
    113111                             allowed = True,
    114112                             )
     113    elif what == "department":
     114        res = context.students_catalog(department=term.strip())
     115        search_set = [r.id for r in res]
    115116    elif what in st_queries:
    116117        if what == "jamb_reg_no":
     
    128129        query = In('portal_type',pt) & Eq('SearchableText',"%s*" % term.strip())
    129130        res = evalAdvancedQuery(query)
    130         if with_review:
    131             query_step += 10
    132             review_res = evalAdvancedQuery(In('portal_type',student_objects) & Eq('review_state',state))
    133131        search_set = []
    134132        if res:
     
    136134                pl = r.getPath().split('/')
    137135                search_set.append(pl[pl.index('students') + 1])
    138         review_set = []
    139         if review_res:
    140             for r in review_res:
    141                 pl = r.getPath().split('/')
    142                 review_set.append(pl[pl.index('students') + 1])
    143     elif what == "department":
    144         res = context.students_catalog(department=term.strip())
    145         search_set = [r.id for r in res]
     136if with_review:
     137    query_step += 10
     138    review_res = evalAdvancedQuery(In('portal_type',student_objects) & Eq('review_state',state))
     139review_set = []
     140if review_res:
     141    for r in review_res:
     142        pl = r.getPath().split('/')
     143        review_set.append(pl[pl.index('students') + 1])
    146144all = []
    147145if only_review:
     
    153151else:
    154152    all = search_set
    155 for a in all[:1000]:
     153for a in all[:500]:
    156154    if a in items:
    157155        continue
Note: See TracChangeset for help on using the changeset viewer.