1 | ## Script (Python) "getApplicantsStatistics" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters= |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: getApplicantsStatistics.py 1277 2007-01-11 21:11:37Z joachim $ |
---|
11 | """ |
---|
12 | return Student Statistics |
---|
13 | """ |
---|
14 | |
---|
15 | import logging |
---|
16 | logger = logging.getLogger('Skins.getApplicantsStatistics') |
---|
17 | |
---|
18 | logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember()) |
---|
19 | if not context.isStaff(): |
---|
20 | return 'Not allowed' |
---|
21 | |
---|
22 | |
---|
23 | info = {} |
---|
24 | res_submitted_pume = context.applicants_catalog(status = 'submitted', screening_type = 'pume') |
---|
25 | res_submitted_pume2 = context.applicants_catalog(status = 'submitted', screening_type = 'pume2') |
---|
26 | res_submitted_cest = context.applicants_catalog(status = 'submitted', screening_type = 'cest') |
---|
27 | res_submitted_sandwich = context.applicants_catalog(status = 'submitted', screening_type = 'sandwich') |
---|
28 | res_submitted_dp = context.applicants_catalog(status = 'submitted', screening_type = 'dp') |
---|
29 | res_not_admitted = context.applicants_catalog(status = 'not admitted') |
---|
30 | res_submitted_pde = context.applicants_catalog(status = 'submitted', screening_type = 'pde') |
---|
31 | res_submitted_pde2 = context.applicants_catalog(status = 'submitted', screening_type = 'pde2') |
---|
32 | res_admitted = context.applicants_catalog(status = 'admitted') |
---|
33 | res_created = context.applicants_catalog(status = 'created') |
---|
34 | |
---|
35 | info['submitted_pume'] = len(res_submitted_pume) |
---|
36 | info['submitted_pume2'] = len(res_submitted_pume2) |
---|
37 | info['submitted_cest'] = len(res_submitted_cest) |
---|
38 | info['submitted_sandwich'] = len(res_submitted_sandwich) |
---|
39 | info['submitted_dp'] = len(res_submitted_dp) |
---|
40 | info['admitted'] = len(res_admitted) |
---|
41 | info['not_admitted'] = len(res_not_admitted) |
---|
42 | info['submitted_pde'] = len(res_submitted_pde) |
---|
43 | info['submitted_pde2'] = len(res_submitted_pde2) |
---|
44 | info['created'] = len(res_created) |
---|
45 | |
---|
46 | return info |
---|
47 | |
---|
48 | |
---|
49 | |
---|