Changeset 1671 for WAeUP_SRP/trunk/skins/waeup_student
- Timestamp:
- 7 Apr 2007, 16:26:28 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py
r1670 r1671 72 72 sid_in_faculty = [s.id for s in context.students_catalog(faculty=f.getId)] 73 73 new_in_faculty = intersect(new_ids,sid_in_faculty) 74 rest = len(new_in_faculty)74 dict['new'] = rest = len(new_in_faculty) 75 75 for state in special_states: 76 76 state_count = len(intersect(state_ids[state], new_in_faculty)) … … 96 96 fac_ids = [f.getId for f in faculties] 97 97 fac_ids.sort() 98 check_dict = {} 99 check_dict['id'] = 'Check' 100 check_dict['new'] = 0 101 check_dict['new_percent'] = 0 102 check_dict['rest'] = 0 103 check_dict['rest_percent'] = 0 104 for state in special_states: 105 check_dict[state] = 0 106 check_dict["%s_percent" % state] = 0 107 98 108 for f in fac_ids: 99 sum = 0 109 total_fac = fac_res[f]['new'] 110 check_dict['new'] = check_dict['new'] + total_fac 111 check_dict['rest'] = check_dict['rest'] + fac_res[f]['rest'] 100 112 for state in special_states: 101 sum += fac_res[f][state] 102 fac_res[f]['%s_percent' % state] = "%.0f" % round(fac_res[f][state]*100/total_new) 103 fac_res[f]['rest_percent'] = "%.0f" % round(fac_res[f]['rest']*100/total_new) 104 sum += fac_res[f]['rest'] 105 fac_res[f]['new'] = sum 113 check_dict[state] = check_dict[state] + fac_res[f][state] 114 if total_fac != 0: 115 fac_res[f]['%s_percent' % state] = "%.0f" % round(fac_res[f][state]*100/total_fac) 116 else: 117 fac_res[f]['%s_percent' % state] = "%.0f" % 0.0 118 if total_fac != 0: 119 fac_res[f]['rest_percent'] = "%.0f" % round(fac_res[f]['rest']*100/total_fac) 120 else: 121 fac_res[f]['rest_percent'] = "%.0f" % 0.0 106 122 l.append(fac_res[f]) 107 123 l.append(check_dict) 108 124 109 125 return l
Note: See TracChangeset for help on using the changeset viewer.