- Timestamp:
- 24 Apr 2007, 18:15:34 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_utilities/setNewEntryMode.py
r1703 r1704 28 28 response.write("%s<br />\r\n" % s) 29 29 30 brains = context.portal_catalog(portal_type = 'Student Application')30 brains = context.portal_catalog(portal_type = 'Student') 31 31 count = 0 32 32 #set_trace() 33 33 for brain in brains: 34 app_doc = brain.getObject().getContent() 34 student_path = brain.getPath() 35 sub_brains = context.portal_catalog(path = student_path) 36 app_doc = None 37 sc_doc = None 38 for sb in sub_brains: 39 if sb.getId == 'application': 40 app_doc = sb.getObject().getContent() 41 elif sb.getId == 'study_course': 42 sc_doc = sb.getObject().getContent() 43 if app_doc is None: 44 continue 35 45 em = getattr(app_doc,'entry_mode',None) 36 data = {'entry_mode': "%s_ft" % em.lower()} 37 app_doc.edit(mapping=data) 46 new_em = "%s_ft" % em.lower() 47 app_doc.edit(mapping={'entry_mode': new_em}) 48 if sc_doc: 49 sc_doc.edit(mapping={'current_mode': new_em}) 38 50 count += 1 39 s = "%d: %s %s -> %s" % (count,brain.getPath(),em, data['entry_mode'])51 s = "%d: %s %s -> %s" % (count,brain.getPath(),em,new_em) 40 52 rwrite(s) 41 53 rwrite('Done')
Note: See TracChangeset for help on using the changeset viewer.