- Timestamp:
- 3 Nov 2007, 12:54:41 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_utilities/moveCourseResults.py
r2508 r2513 40 40 #logger.info('') 41 41 42 brains = aq_students(In('review_state',('courses_registered','courses_validated'))) 42 brains = aq_students(In('review_state',('courses_registered','courses_validated'))) 43 43 total = len(brains) 44 44 logger.info("found %d students" % (total)) … … 46 46 moved = 0 47 47 cocount = 0 48 commit_after = 548 commit_after = 20 49 49 for brain in brains: 50 count += 1 51 if moved and not moved % commit_after: 52 context.waeup_tool.doCommit() 53 logger.info("Committing %s transactions, total %s" % (commit_after,count)) 54 cocount += 1 55 #if cocount > 3: 56 # break 50 count += 1 57 51 already_moved = aq_results(Eq('student_id',brain.id)) 58 52 if len(already_moved) > 0: … … 67 61 continue 68 62 if not results: 69 pass63 continue 70 64 #rwrite('no result objects in %s/study_course/%s' % (brain.id,brain.level)) 71 65 else: 72 logger.info("moving results of student %s" % (brain.id))66 #logger.info("moving results of student %s" % (brain.id)) 73 67 context.course_results.moveResultsHere(study_level,brain.id) 74 68 moved += 1 75 69 logger.info("moved results of student %s" % (brain.id)) 76 msg = "finished moving results of %d students" % (moved) 70 if moved and not moved % commit_after: 71 context.waeup_tool.doCommit() 72 logger.info("Committing %s transactions, total %s" % (commit_after,count)) 73 #cocount += 1 74 #if cocount > 3: 75 # break 76 77 msg = "finished moving results of %d students" % (moved) 77 78 logger.info(msg) 78 79 #rwrite(msg)
Note: See TracChangeset for help on using the changeset viewer.