Changeset 1318 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
18 Jan 2007, 11:12:10 (18 years ago)
Author:
Henrik Bettermann
Message:

statistics prepared for entry_level requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py

    r1286 r1318  
    2929dep['id'] = "All Faculties"
    3030
    31 total_new = aq_students(Eq('level','100'))
     31umequery = Eq('level','100')
     32#dequery = Eq('entry_mode','DE')  # only correct for 2006/2007
     33#total_new = aq_students(umequery or dequery)
     34total_new = aq_students(umequery)
    3235total_new = float(len(total_new))
    3336dep['new'] = "%.0f" % total_new
     
    6669dep['objection_raised_percent'] = "%.0f" % round(ora*100/total_new)
    6770
    68 ret_res = context.portal_catalog(review_state ='returning')
    69 ret_ids = [r.getId for r in ret_res]
    70 total_ret = aq_students(Ge('level','200'))
    71 total_ret = float(len(total_ret))
    72 dep['returning'] = "%.0f" % total_ret
    73 
    7471l.append(dep)
    7572fs = context.portal_catalog(portal_type="Faculty")
     
    7875    dep['id'] = fid
    7976    fquery = Eq('faculty',fid)
    80     squery = Eq('level','100')
    81     fac_res = aq_students(fquery & squery)
     77    #umequery = Eq('level','100')
     78    #fac_res = aq_students(fquery & umequery & dequery)
     79    fac_res = aq_students(fquery & umequery)
    8280    fac_ids = [r.id for r in fac_res]
    8381    total = float(len(fac_res))
     
    113111        dep['objection_raised_percent'] = "%.0f" % round(ora*100/total)
    114112
    115     squery = Ge('level','200')
    116     fac_res = aq_students(fquery & squery)
    117     fac_ids = [r.id for r in fac_res]
    118     ret = len([s for s in fac_ids if s in ret_ids])
    119     dep['returning'] = ret
    120 
    121     if total == 0 and ret == 0:
     113    if total == 0:
    122114        continue
    123115
Note: See TracChangeset for help on using the changeset viewer.