Ignore:
Timestamp:
4 Feb 2007, 08:48:18 (18 years ago)
Author:
Henrik Bettermann
Message:

siehe Email

Location:
WAeUP_SRP/trunk/skins/waeup_utilities
Files:
2 edited

Legend:

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

    r1387 r1388  
    4040res = scat()
    4141for sbrain in res:
    42     ec = "x"
     42    ec = "nor"
    4343    erg = context.results_import(matric_no=sbrain.matric_no)
    4444    if erg and erg[0].Level:
     
    5050                ec = "%s:%s!=%s<br />\n" % (sbrain.matric_no,level,e.Level)
    5151        level = "%d" % (int(level) + 100)
    52         context.students_catalog.modifyRecord(id = sbrain.id, level=level)
     52       
     53        # würde ich an dieser Stelle nicht machen (siehe unten)
     54        #context.students_catalog.modifyRecord(id = sbrain.id, level=level)
     55       
    5356        while True:
    5457            student = getattr(students,sbrain.id,None)
    55             ec = "s"
     58            ec = "nos"
    5659            if student is None:
    5760                break
    58             ec = "S"
     61            ec = "nyr"
    5962            study_course = getattr(student,"study_course", None)
    6063            if study_course is None:
    6164                break
    6265            study_course.getContent().edit(mapping = {'current_level':level})
    63             ec += "C"
     66           
     67            #dies ist der richtige Platz
     68            context.students_catalog.modifyRecord(id = sbrain.id, level=level) 
     69           
     70            ec = "reg"
    6471            break
    65     rwrite(ec)
    66     count += 1
    67     if count > 60:
    68         lc += 1
    69         rwrite("<br />\n%3d " % lc)
    70         count = 0
     72        if sbrain.level:
     73            old_level = str(sbrain.level)
     74        else:
     75            old_level = 'non'
     76        rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />")
     77       
     78    else:
     79        rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no + "<br />")
     80#    count += 1
     81#    if count > 60:
     82#        lc += 1
     83#        rwrite("<br />\n%3d " % lc)
     84#        count = 0
    7185rwrite("<br />\n Done" )
     86
  • WAeUP_SRP/trunk/skins/waeup_utilities/removeResults.py

    r1253 r1388  
    1414
    1515request = REQUEST
     16response = request.RESPONSE
     17
     18def 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
    1624wftool = context.portal_workflow
    1725mtool = context.portal_membership
     
    1927roles = member.getRolesInContext(context)
    2028rcat = context.results_import
     29scat = context.students_catalog
    2130#from Products.zdb import set_trace;set_trace()
    2231if str(member) not in ('admin','joachim'):
    23     return 
    24 count = 0
     32    return
     33rwrite("start <br />")
    2534for m in rcat.uniqueValuesFor('matric_no'):
    26     if m.startswith('ENG'):
    27         res = rcat(matric_no = m)
     35    #if m.startswith('ART'):
     36    res_r = rcat(matric_no = m)
     37    res_s = scat(matric_no = m)
     38    if res_s and res_s[0].course == 'BARTTHR' and res_s[0].level =="500":
    2839        to_del = []
    29         for r in res:
     40        for r in res_r:
    3041            to_del.append(r.key)
    31         for uid in to_del:
    32             rcat.deleteRecord(uid)
    33         count += len(to_del)
    34 return "%d deleted" % count
     42           
     43        #zum Testen auskommentiert   
     44        #for uid in to_del:
     45            #rcat.deleteRecord(uid)
     46           
     47        rwrite(m+" "+res_s[0].course+" "+res_s[0].level + " " + str(len(to_del)) +"<br />")
     48rwrite("<br />\n Done" )       
Note: See TracChangeset for help on using the changeset viewer.