Ignore:
Timestamp:
31 Jan 2007, 16:24:18 (18 years ago)
Author:
joachim
Message:

course registration

M waeup_student/student_index.py
M waeup_student/study_level_view.pt
M waeup_student/getStudyLevelInfo.py
M waeup_student/study_course_view.pt
M waeup_student/getStudyCourseInfo.py
AM waeup_academics/getCourseInfo.py

reindex entry_mode

M waeup_utilities/getFromData_entry_mode.py
M waeup_utilities/reindex_entry_mode.py

File:
1 edited

Legend:

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

    r1363 r1380  
    1212reindex students_catalog entry_mode index
    1313"""
     14request = context.REQUEST
     15session = request.SESSION
     16response = request.RESPONSE
     17students = context.portal_url.getPortalObject().campus.students
     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   
    1424cat = context.students_catalog
    15 
     25ems = cat.uniqueValuesFor('entry_mode')
     26rwrite("entry_mode values: %s<br />\n" % (str(ems)))
     27for 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()
    1631sbrains = cat()
     32count = 0
     33lc = 1
     34rwrite("%3d " % lc)
    1735for sb in sbrains:
    1836    normalized = False
    19     em= context.getFromData_entry_mode(sb.id)
    20     if em:
     37    em = context.getFromData_entry_mode(sb.id)
     38    ec = 'x'
     39    if em is None:
     40        ec = 'n'
     41        em = 'None'
     42    if em in ('UME','DE'):
     43        ec = 'C'
    2144        normalized = True
    2245    elif sb.entry_mode in ('DIRECT', 'DIRECT ENTRY',):
     46        ec = 'D'
    2347        em = 'DE'
    2448        normalized = True
    2549    elif sb.entry_mode in ('U.M.E', 'UNE',):
     50        ec = 'U'
    2651        em ="UME"
    2752        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})
    2864    if normalized:
    2965        cat.modifyRecord(id = sb.id,
    3066                         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
    3173
Note: See TracChangeset for help on using the changeset viewer.