Changeset 1434 for WAeUP_SRP/trunk/skins


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

speed-up department_view

Location:
WAeUP_SRP/trunk/skins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_academics/getCoursesCertificatesInfo.py

    r913 r1434  
    2424cp = brain.getPath()
    2525info['container_path'] = cp
    26 res = context.portal_catalog(container_path="%s/courses" % cp)
    27 items = []
    28 for r in res:
    29     row = {}
    30     ro = r.getObject()
    31     rd = ro.getContent()
    32     row['id'] = r.getId
    33     row['title'] = rd.Title()
    34     row['url'] = ro.absolute_url()
    35     items.append(row)
    36 info['courses'] = items
     26#res = context.portal_catalog(container_path="%s/courses" % cp)
     27#items = []
     28#for r in res:
     29#    row = {}
     30#    ro = r.getObject()
     31#    rd = ro.getContent()
     32#    row['id'] = r.getId
     33#    row['title'] = rd.Title()
     34#    row['url'] = ro.absolute_url()
     35#    items.append(row)
     36#info['courses'] = items
    3737res = context.portal_catalog(container_path="%s/certificates" % cp)
    3838items = []
     
    4747info['certificates'] = items
    4848return info
     49
  • WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py

    r1409 r1434  
    3939line_count = 0
    4040lines = []
    41 #from Products.zdb import set_trace;set_trace()
    4241res = scat()
    4342for sbrain in res:
     
    4847    erg = context.results_import(matric_no=sbrain.matric_no)
    4948    if erg and erg[0].Level:
    50         #lc = "N"
    5149        level_res = erg[0].Level
    5250        everdict = erg[0].Verdict
     
    5452        #if level_cc == 0:
    5553            #lc = "-"
    56         #if "%d00" % level_cc != level_res:
    5754        lc = 100*level_cc - int(level_res)
    5855        verdict,elegible = context.getVerdict(everdict)
    5956        if elegible:
    60             #lc = "S"
    6157            level = "%d00" % (level_cc + 1)
    62         #context.students_catalog.modifyRecord(id = sbrain.id,
    63         #                                      level="",
    64         #                                      verdict = "")
     58        context.students_catalog.modifyRecord(id = sbrain.id,
     59                                              level="",
     60                                              verdict = "")
    6561        while True:
    6662            student = getattr(students,sbrain.id,None)
     
    7268            if study_course is None:
    7369                break
    74             #study_course.getContent().edit(mapping = {'current_level':level,
    75             #                                          'current_verdict':verdict})
    76             #context.students_catalog.modifyRecord(id = sbrain.id,
    77             #                                      level=level,
    78             #                                      verdict=verdict)
     70            study_course.getContent().edit(mapping = {'current_level':level,
     71                                                      'current_verdict':verdict})
     72            context.students_catalog.modifyRecord(id = sbrain.id,
     73                                                  level=level,
     74                                                  verdict=verdict)
    7975            ec = "reg"
    8076            break
    8177
    82         #rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />")
    8378        s = '"%s","%s","%s","%s","%s","%s","%s","%s"' % (str(lc),ec,
    8479                                                           sbrain.id,
     
    9085        #lines.append(s)
    9186    else:
    92         #rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no + "<br />")
    9387        s = '"","%s","%s","%s","",""' % (ec,sbrain.id,sbrain.matric_no)
    9488        #lines.append(s)
Note: See TracChangeset for help on using the changeset viewer.