Ignore:
Timestamp:
23 May 2007, 16:34:51 (17 years ago)
Author:
joachim
Message:

don't commit after each course_result

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/create_level.py

    r1770 r1811  
    102102        context.portal_workflow.doActionFor(course_result,'open')
    103103        course_result.getContent().edit(mapping=d)
    104 level['create_course_results'](cert_id,current_level)
    105 ##res = context.portal_catalog(portal_type="Certificate", id = cert_id)
    106 ##l = []
    107 ##if res:
    108 ##    cert = res[0]
    109 ##    path = cert.getPath()
    110 ##    #set_trace()
    111 ##    query = Eq("path","%s/%s" % (path,current_level)) &\
    112 ##            Eq('portal_type','CertificateCourse')
    113 ##    courses = aq_portal(query)
    114 ##    for c in courses:
    115 ##        d = context.getCourseInfo(c.getId)
    116 ##        cr_id = level.invokeFactory('StudentCourseResult',c.getId)
    117 ##        course_result = getattr(level,cr_id)
    118 ##        context.portal_workflow.doActionFor(course_result,'open')
    119 ##        d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective')
    120 ##        course_result.getContent().edit(mapping=d)
     104#level['create_course_results'](cert_id,current_level)
     105res = context.portal_catalog(portal_type="Certificate", id = cert_id)
     106l = []
     107if res:
     108    cert = res[0]
     109    path = cert.getPath()
     110    #set_trace()
     111    query = Eq("path","%s/%s" % (path,current_level)) &\
     112            Eq('portal_type','CertificateCourse')
     113    courses = aq_portal(query)
     114    for c in courses:
     115        d = context.getCourseInfo(c.getId)
     116        cr_id = level.invokeFactory('StudentCourseResult',c.getId)
     117        course_result = getattr(level,cr_id)
     118        context.portal_workflow.doActionFor(course_result,'open')
     119        d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective')
     120        course_result.getContent().edit(mapping=d)
    121121
    122122return response.redirect("%s/%s" % (context.absolute_url(),current_level))
Note: See TracChangeset for help on using the changeset viewer.