## Script (Python) "getStudentStatistics" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: getStudentStatistics.py 1099 2006-12-20 07:10:58Z henrik $ """ return Student Statistic """ try: from Products.AdvancedQuery import Eq, Between, Le,In aq_portal = context.portal_catalog.evalAdvancedQuery aq_students = context.students_catalog.evalAdvancedQuery except: evalAdvancedQuery = None l = [] if not context.isStaff(): return l dep = {} dep['id'] = "All" dep['students'] = len(context.students_catalog()) dep['clearance_pin_entered'] = len(aq_portal(Eq('review_state','clearance_pin_entered'))) dep['clearance_requested'] = len(aq_portal(Eq('review_state','clearance_requested'))) dep['cleared_and_validated'] = len(aq_portal(Eq('review_state','cleared_and_validated'))) dep['objection_raised'] = len(aq_portal(Eq('review_state','objection_raised'))) l.append(dep) return l