Changeset 1551 for WAeUP_SRP/trunk/skins/waeup_student
- Timestamp:
- 15 Mar 2007, 11:07:15 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py
r1536 r1551 13 13 """ 14 14 import logging 15 logger = logging.getLogger('S tudent.Statistics')15 logger = logging.getLogger('Skins.getRetStudentStatistics') 16 16 17 17 try: … … 21 21 except: 22 22 evalAdvancedQuery = None 23 logger.info(' "%s","invoked returning statistics"' % context.portal_membership.getAuthenticatedMember())23 logger.info('%s invoked returning statistics' % context.portal_membership.getAuthenticatedMember()) 24 24 l = [] 25 25 if not context.isStaff(): 26 26 return l 27 27 dep = {} 28 sum = 029 28 dep['id'] = "All Faculties" 30 29 31 #from Products.zdb import set_trace;set_trace()32 30 33 ret_res = context.portal_catalog(review_state ='returning') 34 ret_ids = [r.getId for r in ret_res] 35 ret = len(ret_res) 36 dep['total'] = ret 31 ret_res1 = context.portal_catalog(review_state = 'returning') 32 ret_ids1 = [r.getId for r in ret_res1] 33 total_ret = len(ret_ids1) 34 35 ret_res2 = context.portal_catalog(review_state = ('school_fee_paid','courses_registered','courses_validated',)) 36 ret_ids2 = [r.getId for r in ret_res2] 37 38 retquery = Ge('level','300') | (Eq('level','200') & Eq('entry_mode','UME')) 39 ret_res3 = aq_students(retquery) 40 ret_ids3 = [r.id for r in ret_res3] 37 41 38 42 l.append(dep) 43 sum_ret = 0 44 sum_sfp = 0 39 45 fs = context.portal_catalog(portal_type="Faculty") 40 46 for fid in [f.getId for f in fs]: … … 45 51 stud_ids = [r.id for r in stud_res] 46 52 total = float(len(stud_res)) 47 48 53 if total == 0: 49 54 continue 50 51 ret = len([s for s in stud_ids if s in ret_ids]) 52 dep['returned'] = ret 53 sum += ret 54 55 if ret == 0: 56 continue 57 55 sfp = len([s for s in stud_ids if s in ret_ids2 and s in ret_ids3]) 56 dep['sfp'] = sfp 57 ret = len([s for s in stud_ids if s in ret_ids1]) 58 dep['ret'] = ret 59 sum_ret += ret 60 sum_sfp += sfp 61 58 62 l.append(dep) 59 63 60 l[0]['sum'] = sum 64 l[0]['ret'] = sum_ret 65 l[0]['sfp'] = sum_sfp 66 l[0]['total_ret'] = total_ret + sum_sfp 67 l[0]['total_li'] = sum_ret + sum_sfp 68 61 69 62 70 return l -
WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt
r1532 r1551 24 24 <h3>Returning Student Statistics</h3> 25 25 <br /> 26 <span tal:content="python:departments[0]['total_ret']" /> 27 returning student records have been imported. 28 <span tal:content="python:departments[0]['total_li']" /> returning students 29 have logged in. 30 <br /><br /> 26 31 <span tal:condition="not:isAnon"> 27 32 <table> 28 33 <tr class="odd ajaxtd"> 29 34 <th >Faculty</th> 30 <th align="right">Returning</th> 35 <th align="right">RET</th> 36 <th align="right">SFP</th> 31 37 </tr> 32 38 <tr tal:define="d python:departments[0]" … … 34 40 <td width="80px">All Faculties</td> 35 41 <td width="80px" align="right"> 36 <span tal:content="d/sum" /> of <span tal:content="d/total" /> 42 <span tal:content="d/ret" /> 43 </td> 44 <td width="80px" align="right"> 45 <span tal:content="d/sfp" /> 37 46 </td> 38 47 </tr> … … 41 50 <td width="80px"> <span tal:content="d/id" /> </td> 42 51 <td width="80px" align="right"> 43 <span tal:content="d/returned " /> 44 </td> 52 <span tal:content="d/ret" /> 53 </td> 54 <td width="80px" align="right"> 55 <span tal:content="d/sfp" /> 56 </td> 45 57 </tr> 46 58 </table> 47 59 <br /> 60 <table> 61 <tr><td>RET:</td> <td>Returning students who only logged in</td></tr> 62 <tr><td>SFP:</td> <td>Returning students who paid their school fee</td></tr> 63 </table> 48 64 </span> 49 65 </span>
Note: See TracChangeset for help on using the changeset viewer.