Changeset 1652 for WAeUP_SRP/trunk/skins/waeup_student
- Timestamp:
- 27 Mar 2007, 22:46:46 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/create_level.py
r1640 r1652 31 31 current_level = student.level 32 32 in_progress = request.get('in_progress','not started') 33 level_created = request.get('level_created','xxx') 34 create_level = request.get('create_level',None) 33 35 34 if context.hasObject(current_level) :36 if context.hasObject(current_level) and create_level : 35 37 logger.info('%s", level %s already exists' % (student.id,current_level)) 36 #response.redirect("%s/%s" % (context.absolute_url(),current_level))37 38 return 38 39 … … 48 49 ## return 49 50 50 51 context.invokeFactory('StudentStudyLevel',"%s" % current_level) 52 level = getattr(context,"%s" % current_level) 53 context.portal_workflow.doActionFor(level,'open') 54 study_session = context.getSessionString() 55 level.getContent().edit(mapping={'session': study_session}) 56 context.portal_workflow.doActionFor(level,'close_for_edit') 51 if level_created == current_level: 52 level = getattr(context,"%s" % current_level) 53 else: 54 context.invokeFactory('StudentStudyLevel',"%s" % current_level) 55 level = getattr(context,"%s" % current_level) 56 context.portal_workflow.doActionFor(level,'open') 57 study_session = context.getSessionString() 58 level.getContent().edit(mapping={'session': study_session}) 59 context.portal_workflow.doActionFor(level,'close_for_edit') 60 response.redirect("%s?level_created=%s" % (context.absolute_url(),current_level)) 57 61 results = context.results_import(matric_no = student.matric_no) 58 62 if results: … … 91 95 context.portal_workflow.doActionFor(course_result,'open') 92 96 course_result.getContent().edit(mapping=d) 93 res = context.portal_catalog(portal_type="Certificate", id = cert_id) 94 l = [] 95 if res: 96 cert = res[0] 97 path = cert.getPath() 98 query = Eq("path",path) &\ 99 Eq('portal_type','CertificateCourse') &\ 100 Eq('SearchableText', "%s" % current_level) 101 courses = aq_portal(query) 102 for c in courses: 103 d = context.getCourseInfo(c.getId) 104 cr_id = level.invokeFactory('StudentCourseResult',c.getId) 105 course_result = getattr(level,cr_id) 106 context.portal_workflow.doActionFor(course_result,'open') 107 d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective') 108 course_result.getContent().edit(mapping=d) 109 97 level['create_course_results'](cert_id,current_level) 98 ##res = context.portal_catalog(portal_type="Certificate", id = cert_id) 99 ##l = [] 100 ##if res: 101 ## cert = res[0] 102 ## path = cert.getPath() 103 ## #set_trace() 104 ## query = Eq("path","%s/%s" % (path,current_level)) &\ 105 ## Eq('portal_type','CertificateCourse') 106 ## courses = aq_portal(query) 107 ## for c in courses: 108 ## d = context.getCourseInfo(c.getId) 109 ## cr_id = level.invokeFactory('StudentCourseResult',c.getId) 110 ## course_result = getattr(level,cr_id) 111 ## context.portal_workflow.doActionFor(course_result,'open') 112 ## d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective') 113 ## course_result.getContent().edit(mapping=d) 114 110 115 return response.redirect("%s/%s" % (context.absolute_url(),current_level)) 111 116
Note: See TracChangeset for help on using the changeset viewer.