Changeset 3349 for WAeUP_SRP/base/skins/waeup_student
- Timestamp:
- 18 Mar 2008, 17:54:22 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_student/admitStudents.py
r3340 r3349 44 44 admitted = 0 45 45 cocount = 0 46 commit_after = 20 46 old_commit_count = -1 47 commit_after = 40 47 48 d = {'status': 'created'} 48 49 reg_nos = [brain.reg_no for brain in brains] 50 with_timing = True 49 51 for reg_no in reg_nos: 50 52 count += 1 51 if admitted and not admitted % commit_after: 53 must_commit = (admitted != old_commit_count) and (not admitted % commit_after) 54 if must_commit: 55 old_commit_count = admitted 52 56 context.waeup_tool.doCommit() 53 57 logger.info("Committing %s transactions, total %s" % (commit_after,count)) 54 58 cocount += 1 55 #if cocount > 1:56 #break59 if cocount > 2: 60 break 57 61 brain = aq_applicants(Eq('reg_no',reg_no))[0] 58 62 #logger.info("start creating objects of student %s" % (brain.reg_no)) 59 sid = d['student_id'] = context.waeup_tool.admitOneStudent(brain,entry_session,pin_password) 63 sid = d['student_id'] = context.waeup_tool.admitOneStudent(brain, 64 entry_session, 65 pin_password, 66 with_timing = with_timing) 67 60 68 if sid is not None: 61 69 d['reg_no'] = reg_no 62 70 context.applicants_catalog.modifyRecord(**d) 63 71 logger.info("created objects of student %s with id %s" % (reg_no,sid)) 72 if with_timing: 73 data = context.waeup_tool.get_timing_data() 74 logger.info("timing %(i_time)6.2f/%(a_time)6.2f" % data['total']) 64 75 admitted += 1 65 76 else:
Note: See TracChangeset for help on using the changeset viewer.