- Timestamp:
- 25 Feb 2007, 15:06:54 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelForNewStudents.py
r1490 r1491 54 54 commit_count = 0 55 55 logger.info("started for %s students" % len(res)) 56 to_change = {} 56 57 for sbrain in res: 57 58 #count_full += 1 58 59 #rwrite("%s: %s %s %s <br />" % (count_full,sbrain.id,sbrain.entry_mode,sbrain.level)) 59 60 student_obj = getattr(students,sbrain.id) 61 changed = False 60 62 if sbrain.entry_mode == "": 61 63 if not student_obj.hasObject('application'): 62 64 rwrite("%s %s %s application not found <br />" % (sbrain.id,sbrain.entry_mode,level)) 63 65 continue 66 changed = True 64 67 app_doc = student_obj.application.getContent() 65 68 entry_mode = app_doc.entry_mode … … 67 70 entry_mode = sbrain.entry_mode 68 71 if entry_mode == "DE": 72 changed = True 69 73 level = "200" 70 74 else: 71 75 level = "100" 72 students_cat.modifyRecord(id=sbrain.id, 73 level=level, 74 entry_mode=entry_mode) 76 if changed: 77 d = {} 78 d['id'] = sbrain.id 79 d['level'] = level 80 d['entry_mode'] = entry_mode 81 to_change[sbrain.id] = d 82 ## students_cat.modifyRecord(id=sbrain.id, 83 ## level=level, 84 ## entry_mode=entry_mode) 75 85 if not student_obj.hasObject('study_course'): 76 86 rwrite("%s %s %s study_course not found <br />" % (sbrain.id,sbrain.entry_mode,level)) … … 85 95 commit_count = 0 86 96 rwrite("%s: %s %s %s <br />" % (count,sbrain.id,entry_mode,level)) 97 for entry in to_change.keys(): 98 students_cat.modifyRecord(**to_change[entry]) 87 99 rwrite("finished") 88 100 logger.info("finished %s students" % count)
Note: See TracChangeset for help on using the changeset viewer.