Changeset 2249 for WAeUP_SRP/base/skins/waeup_student
- Timestamp:
- 17 Sep 2007, 06:49:57 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_student/search_students.py
r1845 r2249 14 14 import logging 15 15 logger = logging.getLogger('Skins.search_students') 16 from DateTime import DateTime16 #from DateTime import DateTime 17 17 # 18 18 #with_timer = True 19 with_timer = False19 #with_timer = False 20 20 # 21 21 request = REQUEST … … 203 203 204 204 if only_review or with_review or co_view: 205 if with_timer:206 start = DateTime().timeTime()207 logger.info('"%s","start 100"' % member)208 205 query = Eq('review_state',state) 209 206 review_res = aq_portal(query) … … 211 208 logger.info('%s searches for students in review_state %s' % (member,state)) 212 209 213 if with_timer:214 end = DateTime().timeTime()215 logger.info('"%s","searchtime","%6.2f"' % (member,end-start))216 210 if co_view: 217 211 only_review = False 218 212 with_review = True 219 if with_timer:220 start = DateTime().timeTime()221 logger.info('"%s","start 200"' % member)222 213 query = In('faculty',faculties) | In('department',departments) 223 214 res = aq_students(query) 224 if with_timer:225 end = DateTime().timeTime()226 logger.info('"%s","searchtime","%6.2f"' % (member,end-start))227 start = DateTime().timeTime()228 215 search_set = [r.id for r in res] 229 if with_timer:230 end = DateTime().timeTime()231 logger.info('"%s","searchtime","%6.2f"' % (member,end-start))232 216 elif ca_view: 233 217 only_review = False 234 218 with_review = True 235 if with_timer:236 start = DateTime().timeTime()237 logger.info('"%s","start 200"' % member)238 219 courses = [cl.split('/')[0] for cl in certificate_level] 239 220 levels = [cl.split('/')[1] for cl in certificate_level] 240 221 query = In('course',courses) & In('level',levels) 241 222 res = aq_students(query) 242 if with_timer:243 end = DateTime().timeTime()244 logger.info('"%s","searchtime","%6.2f"' % (member,end-start))245 start = DateTime().timeTime()246 223 search_set = [r.id for r in res] 247 if with_timer:248 end = DateTime().timeTime()249 logger.info('"%s","searchtime","%6.2f"' % (member,end-start))250 if with_timer:251 logger.info('"%s","start 300"' % member)252 start = DateTime().timeTime()253 224 if review_res: 254 225 review_set = [r.getId for r in review_res] 255 if with_timer:256 end = DateTime().timeTime()257 logger.info('"%s","searchtime","%6.2f"' % (member,end-start))258 logger.info('"%s","start 400"' % member)259 start = DateTime().timeTime()260 226 if only_review: 261 227 all = review_set … … 267 233 else: 268 234 all = search_set 269 if with_timer:270 end = DateTime().timeTime()271 logger.info('"%s","searchtime","%6.2f"' % (member,end-start))272 235 items = all[:500] 273 236 students = [] 274 if with_timer:275 logger.info('"%s","start 500"' % member)276 start = DateTime().timeTime()277 237 if items: 278 238 for item in items: … … 288 248 else: 289 249 students.append(info) 290 if with_timer:291 end = DateTime().timeTime()292 logger.info('"%s","searchtime","%6.2f"' % (member,end-start))293 294 250 return context.search_students_form(rendered = rend, 295 251 psm = "",
Note: See TracChangeset for help on using the changeset viewer.