Ignore:
Timestamp:
11 Feb 2007, 22:35:16 (18 years ago)
Author:
Henrik Bettermann
Message:

Protolollierung geändert

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py

    r1407 r1408  
    1515session = request.SESSION
    1616response = request.RESPONSE
     17setheader = request.RESPONSE.setHeader
    1718students = context.portal_url.getPortalObject().campus.students
    1819
    19 #def rwrite(s):
    20 #    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
    21 #    response.write(s)
     20def rwrite(s):
     21    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
     22    response.write(s)
    2223
    2324cat = context.students_catalog
    2425
    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)))
     26ems = cat.uniqueValuesFor('entry_mode')
     27rwrite("entry_mode values: %s<br />\n" % (str(ems)))
     28for em in ems:
     29    res = cat(entry_mode = em)
     30    rwrite("entry_mode: %s = %d<br />\n" % (em,len(res)))
    3031
    3132sbrains = cat()
     
    3738    em = context.getFromData_entry_mode(sb.id)
    3839    ec = 'x'
     40    level_cat = sb.level
    3941    if em in ('UME','DE'):
    4042        ec = 'cup'
    4143        #cat.modifyRecord(id = sb.id,entry_mode = em)
    42         lines.append('"%s","%s","","%s",""' % (ec,sb.id,em))
    43         #rwrite(ec +"--"+ sb.id +"--"+ em +"<br />")
     44        s = '"%s","%s","","%s","","%s"' % (ec,sb.id,em,level_cat)
     45        #lines.append('"%s","%s","","%s",""' % (ec,sb.id,em))
     46        rwrite("%s<br />" %s)
    4447    else:
    4548        ret = context.returning_import(matric_no=sb.matric_no)
    4649        moe = ret[0].Mode_of_Entry
     50       
    4751        if moe in ('DE','DIRECT', 'DIRECT ENTRY',):
    4852            ec = 'de'
     
    5862        #app = getattr(getattr(students,sb.id),'application',None)
    5963        #if app is not None:
    60             #app.getContent().edit(mapping={'entry_mode': new_em})
    61             #cat.modifyRecord(id = sb.id,entry_mode = new_em)
     64        #    app.getContent().edit(mapping={'entry_mode': new_em})
     65        #    cat.modifyRecord(id = sb.id,entry_mode = new_em)
    6266        #else:
    63             #cat.modifyRecord(id = sb.id,entry_mode = "")
     67        #    cat.modifyRecord(id = sb.id,entry_mode = "")
    6468
    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 />")
     69        s = '"%s","%s","%s","%s","%s","%s"' % (ec,sb.id,sb.matric_no,moe,new_em,level_cat)
     70        #lines.append('"%s","%s","%s","%s","%s"' % (ec,sb.id,sb.matric_no,moe,new_em))
     71        rwrite("%s<br />" %s)
    6772
    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)
     73#setheader('Content-type','text/semicolon-seperated-values')
     74#setheader('Content-Disposition:', 'attachment; filename="fixLevelExport.csv"')
     75#setheader('Expires',  'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past
     76#setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1
     77#setheader('Cache-Control', 'post-check=0,pre-check=0')
     78#setheader('Pragma', 'no-cache') # HTTP/1.0
     79#return '\n'.join(lines)
     80
     81rwrite("<br />\n Done" )
     82
Note: See TracChangeset for help on using the changeset viewer.