Changeset 2507 for WAeUP_SRP/base/skins


Ignore:
Timestamp:
2 Nov 2007, 20:42:32 (17 years ago)
Author:
Henrik Bettermann
Message:

skip already moved results much faster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_utilities/moveCourseResults.py

    r2502 r2507  
    2727logger = logging.getLogger('Skins.moveCourseResults')
    2828from Products.AdvancedQuery import Eq, Between, Le,In
    29 #aq_results = context.course_results.evalAdvancedQuery
     29aq_results = context.course_results.evalAdvancedQuery
    3030aq_students = context.students_catalog.evalAdvancedQuery
    3131students = context.portal_url.getPortalObject().campus.students
     
    5353        logger.info("Committing %s transactions, total %s" % (commit_after,count))
    5454        cocount += 1
    55         if cocount > 3:
    56             break
     55        #if cocount > 3:
     56        #    break
     57    already_moved = aq_results(Eq('student_id',brain.id))
     58    if len(already_moved) > 0:
     59        continue
    5760    try:
    5861        study_level = getattr(getattr(getattr(students,brain.id),
     
    6467        continue
    6568    if not results:
    66         rwrite('no courses %s/study_course/%s' % (brain.id,brain.level))
     69        rwrite('no result objects in %s/study_course/%s' % (brain.id,brain.level))
    6770    else:
    6871        logger.info("moving  results of student %s" % (brain.id))
     
    7376logger.info(msg)
    7477rwrite(msg)
     78
Note: See TracChangeset for help on using the changeset viewer.