Changeset 1392 for WAeUP_SRP/trunk/skins/waeup_utilities
- Timestamp:
- 5 Feb 2007, 15:59:08 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_utilities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py
r1391 r1392 44 44 res = scat() 45 45 for sbrain in res: 46 47 old_level = str(sbrain.level) 48 46 49 if str(sbrain.level) == '100': 47 50 ec = "new" … … 58 61 level = "%d" % (int(level) + 100) 59 62 60 # würde ich an dieser Stelle nicht machen (siehe unten) 61 #context.students_catalog.modifyRecord(id = sbrain.id, level=level) 63 context.students_catalog.modifyRecord(id = sbrain.id, level="") 62 64 63 65 while True: … … 70 72 if study_course is None: 71 73 break 72 # zum Testen auskommentiert73 #study_course.getContent().edit(mapping = {'current_level':level})74 74 75 #dies ist der richtige Platz75 study_course.getContent().edit(mapping = {'current_level':level}) 76 76 context.students_catalog.modifyRecord(id = sbrain.id, level=level) 77 77 78 78 ec = "reg" 79 79 break 80 if sbrain.level: 81 old_level = str(sbrain.level) 82 else: 83 old_level = 'non' 80 84 81 # rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />") 85 82 -
WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py
r1389 r1392 16 16 response = request.RESPONSE 17 17 students = context.portal_url.getPortalObject().campus.students 18 def rwrite(s): 19 response.setHeader('Content-type','text/html; charset=ISO-8859-15') 20 #response.setHeader('Content-length','%d' % (len(s))) 21 #response.setStatus('OK') 22 response.write(s) 23 18 19 #def rwrite(s): 20 # response.setHeader('Content-type','text/html; charset=ISO-8859-15') 21 # response.write(s) 22 24 23 cat = context.students_catalog 25 ems = cat.uniqueValuesFor('entry_mode') 26 rwrite("entry_mode values: %s<br />\n" % (str(ems))) 27 for em in ems: 28 res = cat(entry_mode = em) 29 rwrite("entry_mode: %s = %d<br />\n" % (em,len(res))) 30 #from Products.zdb import set_trace;set_trace() 24 25 #ems = cat.uniqueValuesFor('entry_mode') 26 #rwrite("entry_mode values: %s<br />\n" % (str(ems))) 27 #for em in ems: 28 # res = cat(entry_mode = em) 29 # rwrite("entry_mode: %s = %d<br />\n" % (em,len(res))) 30 31 31 sbrains = cat() 32 32 count = 0 33 lines = [] 33 34 34 35 for sb in sbrains: 35 normalized = False 36 36 37 em = context.getFromData_entry_mode(sb.id) 37 38 ec = 'x' 38 39 if em in ('UME','DE'): 39 ec = 'cu '40 ec = 'cup' 40 41 #cat.modifyRecord(id = sb.id,entry_mode = em) 41 rwrite(ec +"--"+ sb.id +"--"+ em +"<br />") 42 lines.append('"%s","%s","","%s",""' % (ec,sb.id,sb.em)) 43 #rwrite(ec +"--"+ sb.id +"--"+ em +"<br />") 42 44 else: 43 45 ret = context.returning_import(matric_no=sb.matric_no) … … 47 49 new_em = 'DE' 48 50 elif moe in ('UME','U.M.E', 'UNE',): 49 ec = 'um '51 ec = 'ume' 50 52 new_em ="UME" 51 53 else: 52 ec = 'un '54 ec = 'unk' 53 55 new_em = 'unknown' 54 56 moe = 'none' … … 59 61 #cat.modifyRecord(id = sb.id,entry_mode = new_em) 60 62 #else: 61 #cat.modifyRecord(id = sb.id,entry_mode = None) 62 63 rwrite(ec +"--"+ sb.id +"--"+ em +"--"+ moe +"--"+ new_em +"<br />") 63 #cat.modifyRecord(id = sb.id,entry_mode = "") 64 64 65 lines.append('"%s","%s","%s","%s","%s"' % (ec,sb.id,sb.matric_no,moe,new_em)) 66 #rwrite(ec +"--"+ sb.id +"--"+ em +"--"+ moe +"--"+ new_em +"<br />") 67 68 setheader('Content-type','text/semicolon-seperated-values') 69 setheader('Content-Disposition:', 'attachment; filename="fixLevelExport.csv"') 70 setheader('Expires', 'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past 71 setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1 72 setheader('Cache-Control', 'post-check=0,pre-check=0') 73 setheader('Pragma', 'no-cache') # HTTP/1.0 74 return '\n'.join(lines)
Note: See TracChangeset for help on using the changeset viewer.