- Timestamp:
- 27 Jul 2007, 10:17:53 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py
r1788 r2067 27 27 'courses_validated', 28 28 ) 29 full_time = ('ume_ft','de_ft','ug_ft','pg_ft') 30 part_time = ( 'de_pt','ug_pt','pg_pt') 31 29 32 faculties = context.portal_catalog(portal_type="Faculty") 30 33 … … 37 40 dict['id'] = 'All Faculties' 38 41 dict['title'] = 'All Faculties' 39 res = context.students_catalog(entry_session = entry_sessions) 40 dict['total'] = len(res) 42 43 res_ft = context.students_catalog(entry_session = entry_sessions, mode = full_time) 44 dict['total_ft'] = len(res_ft) 45 46 res_pt = context.students_catalog(entry_session = entry_sessions, mode = part_time) 47 dict['total_pt'] = len(res_pt) 48 41 49 for state in ret_states: 42 res = context.students_catalog(entry_session = entry_sessions, review_state = state) 43 dict[state] = len(res) 44 statepercent = state+'_percent' 45 if dict['total'] > 0: 46 dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total']) 50 # full_time 51 res_ft = context.students_catalog(entry_session = entry_sessions, review_state = state, mode = full_time) 52 state_ft = state + '_ft' 53 dict[state_ft] = len(res_ft) 54 statepercent = state+'_ft_percent' 55 if dict['total_ft'] > 0: 56 dict[statepercent] = "%.0f" % round(dict[state_ft]*100.0/dict['total_ft']) 47 57 else: 48 58 dict[statepercent] = 0 59 60 # part_time 61 res_pt = context.students_catalog(entry_session = entry_sessions, review_state = state, mode = part_time) 62 state_pt = state + '_pt' 63 dict[state_pt] = len(res_pt) 64 statepercent = state+'_pt_percent' 65 if dict['total_pt'] > 0: 66 dict[statepercent] = "%.0f" % round(dict[state_pt]*100.0/dict['total_pt']) 67 else: 68 dict[statepercent] = 0 69 49 70 l.append(dict) 71 50 72 51 73 for f in faculties: … … 53 75 dict['id'] = f.getId 54 76 dict['title'] = f.Title 55 res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId) 56 dict['total'] = len(res) 77 res_ft = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, mode = full_time) 78 dict['total_ft'] = len(res_ft) 79 res_pt = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, mode = part_time) 80 dict['total_pt'] = len(res_pt) 57 81 for state in ret_states: 58 res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, review_state = state) 59 dict[state] = len(res) 60 statepercent = state+'_percent' 61 if dict['total'] > 0: 62 dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total']) 82 # full_time 83 res_ft = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, review_state = state, mode = full_time) 84 state_ft = state + '_ft' 85 dict[state_ft] = len(res_ft) 86 statepercent = state+'_ft_percent' 87 if dict['total_ft'] > 0: 88 dict[statepercent] = "%.0f" % round(dict[state_ft]*100.0/dict['total_ft']) 63 89 else: 64 90 dict[statepercent] = 0 91 92 # part_time 93 res_pt = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, review_state = state, mode = part_time) 94 state_pt = state + '_pt' 95 dict[state_pt] = len(res_pt) 96 statepercent = state+'_pt_percent' 97 if dict['total_pt'] > 0: 98 dict[statepercent] = "%.0f" % round(dict[state_pt]*100.0/dict['total_pt']) 99 else: 100 dict[statepercent] = 0 101 65 102 l.append(dict) 66 103
Note: See TracChangeset for help on using the changeset viewer.