Changeset 1389 for WAeUP_SRP/trunk/skins
- Timestamp:
- 4 Feb 2007, 12:44:50 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_utilities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_utilities/getFromData_entry_mode.py
r1380 r1389 18 18 app = getattr(student,'application',None) 19 19 if app is None: 20 return None20 return "nyr" 21 21 #from Products.zdb import set_trace;set_trace() 22 22 em = app.getContent().entry_mode 23 23 if em: 24 24 return em 25 return "None" 25 return "none" 26 -
WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py
r1380 r1389 31 31 sbrains = cat() 32 32 count = 0 33 lc = 1 34 rwrite("%3d " % lc) 33 35 34 for sb in sbrains: 36 35 normalized = False 37 36 em = context.getFromData_entry_mode(sb.id) 38 37 ec = 'x' 39 if em is None:40 ec = 'n'41 em = 'None'42 38 if em in ('UME','DE'): 43 ec = 'C' 44 normalized = True 45 elif sb.entry_mode in ('DIRECT', 'DIRECT ENTRY',): 46 ec = 'D' 47 em = 'DE' 48 normalized = True 49 elif sb.entry_mode in ('U.M.E', 'UNE',): 50 ec = 'U' 51 em ="UME" 52 normalized = True 53 elif not sb.entry_mode: 54 ec = 'u' 55 em ="UME" 56 normalized = True 57 if ec != "C" and em != sb.entry_mode: 58 #from Products.zdb import set_trace;set_trace() 59 app = getattr(getattr(students,sb.id),'application',None) 60 ec = 'a' 61 if app is not None: 62 ec = 'A' 63 app.getContent().edit(mapping={'entry_mode': sb.entry_mode}) 64 if normalized: 65 cat.modifyRecord(id = sb.id, 66 entry_mode = em) 67 rwrite(ec) 68 count += 1 69 if count > 60: 70 lc += 1 71 rwrite("<br />\n%3d " % lc) 72 count = 0 39 ec = 'cu' 40 #cat.modifyRecord(id = sb.id,entry_mode = em) 41 rwrite(ec +"--"+ sb.id +"--"+ em +"<br />") 42 else: 43 ret = context.returning_import(matric_no=sb.matric_no) 44 moe = ret[0].Mode_of_Entry 45 if moe in ('DE','DIRECT', 'DIRECT ENTRY',): 46 ec = 'de' 47 new_em = 'DE' 48 elif moe in ('UME','U.M.E', 'UNE',): 49 ec = 'um' 50 new_em ="UME" 51 else: 52 ec = 'un' 53 new_em = 'unknown' 54 moe = 'none' 73 55 56 #app = getattr(getattr(students,sb.id),'application',None) 57 #if app is not None: 58 #app.getContent().edit(mapping={'entry_mode': new_em}) 59 #cat.modifyRecord(id = sb.id,entry_mode = new_em) 60 #else: 61 #cat.modifyRecord(id = sb.id,entry_mode = None) 62 63 rwrite(ec +"--"+ sb.id +"--"+ em +"--"+ moe +"--"+ new_em +"<br />") 64
Note: See TracChangeset for help on using the changeset viewer.