Changeset 596 for WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py
- Timestamp:
- 29 Sep 2006, 14:14:40 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py
r589 r596 54 54 state = ds.get('review_state') 55 55 term = ds.get('search_string') 56 if state == " ----- ":57 state = ''58 56 err = False 59 57 if not term and what in ('student_edit','jamb_id','name','matric_no'): 60 psm = "You must specify a search string "58 psm = "You must specify a search string when searching in 'All States'" 61 59 err = True 62 60 elif '*' in term: 63 psm = " You cannot use '*'"61 psm = "you cannot use the '*' alone" 64 62 err = True 65 63 if err: … … 70 68 is_manager = is_manager, 71 69 ) 72 onlyreview = state and what == "review_state"70 with_review = state != "all" 73 71 items = [] 74 72 res = [] 75 73 portal_type_query = {'query':['Student','StudentApplication','StudentPersonal']} 76 74 st_queries = ('jamb_id','matric_no','name') 75 onlyreview = with_review and not what 77 76 if onlyreview: 78 77 res = catalog(portal_type=portal_type_query, 79 78 review_state=state) 80 79 elif what == "student_id": 81 res = catalog(portal_type='Student', 82 id = term.strip()) 80 if with_review: 81 res = catalog(portal_type='Student', 82 id = term.strip(), 83 review_state=state) 84 else: 85 res = catalog(portal_type='Student', 86 id = term.strip()) 83 87 elif what in st_queries: 84 88 if what == "jamb_id": … … 91 95 pt = portal_type_query 92 96 st = "%s*" % term.strip() 93 try: 94 res = catalog(portal_type=pt,SearchableText=st,) 95 except: 96 return context.students_manager_view(rendered = rend, 97 psm = 'Searchstring "%s" not allowed' % term, 98 #psm = "%s, %s" % (psm,ds), 99 students = items, 100 is_manager = is_manager, 101 ) 97 if with_review: 98 try: 99 res = catalog(portal_type=pt,SearchableText=st, 100 review_state=state) 101 except: 102 return context.students_manager_view(rendered = rend, 103 psm = 'Searchstring "%s" not allowed' % term, 104 #psm = "%s, %s" % (psm,ds), 105 students = items, 106 is_manager = is_manager, 107 ) 108 else: 109 try: 110 res = catalog(portal_type=pt,SearchableText=st,) 111 except: 112 return context.students_manager_view(rendered = rend, 113 psm = 'Searchstring "%s" not allowed' % term, 114 #psm = "%s, %s" % (psm,ds), 115 students = items, 116 is_manager = is_manager, 117 ) 102 118 103 119 if res:
Note: See TracChangeset for help on using the changeset viewer.