source: main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py @ 13061

Last change on this file since 13061 was 13011, checked in by Henrik Bettermann, 9 years ago

Reorganize pg application categorization.

  • Property svn:keywords set to Id
File size: 3.2 KB
RevLine 
[7696]1## $Id: utils.py 13011 2015-05-28 13:00:16Z henrik $
2##
3## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18"""General helper functions and utilities for the application section.
19"""
20
[8821]21from kofacustom.nigeria.applicants.utils import NigeriaApplicantsUtils
[8647]22from waeup.kofa.applicants.workflow import (INITIALIZED,
23    STARTED, PAID, ADMITTED, NOT_ADMITTED, SUBMITTED, CREATED)
[8051]24from waeup.uniben.interfaces import MessageFactory as _
[7696]25
[8247]26
[8647]27
[11782]28class CustomApplicantsUtils(NigeriaApplicantsUtils):
[7696]29    """A collection of parameters and methods subject to customization.
30    """
31
[9635]32    APP_TYPES_DICT = {
33        'pude': ['Post-UDE Screening', 'PUDE'],
[13011]34        #'prence': ['Pre-NCE Programme', 'PRE'],
[9635]35        'sandwich': ['Part-Time Degree in Education', 'SAND'],
36        'pt': ['Part-Time Degree Programmes', 'PTP'],
[11827]37        'ptext': ['Part-Time Degree Programmes (extended application)', 'PTP'],
[9635]38        'putme': ['Post-UTME Screening Exercise', 'PUTME'],
39        'app': ['General Studies', 'APP'],
40        'cest': ['Common Entry Screening Test', 'CEST'],
41        'ct': ['Certificate Programmes', 'CTP'],
42        'dp': ['Diploma Programmes', 'DPP'],
43        'dpft': ['Diploma Full-Time Programmes', 'DPP'],
[13011]44        #'pce': ['PCE Screening', 'PCE'],
45        'pg': ['Postgraduate Programmes (main advert)', 'PG'],
46        'pga': ['Postgraduate Programmes (1st supplementary advert)', 'PG'],
47        'pgb': ['Postgraduate Programmes (2nd supplementary advert)', 'PG'],
48        'pgc': ['Postgraduate Programmes (3rd supplementary advert)', 'PG'],
49
50        #'pgft': ['Postgraduate Full-Time Programmes', 'PG'],
51        #'pgpt': ['Postgraduate Part-Time Programmes', 'PG'],
52        #'pgnew': ['Postgraduate Programmes (supplementary application #1)', 'PG'],
53        #'pgnewtwo': ['Postgraduate Programmes (supplementary application #2)', 'PG'],
54        #'pgext': ['Postgraduate Programmes (extended application)', 'PG']
[9635]55        }
56
57
[8647]58    # Temporarily disabled
59    def xxx_getApplicantsStatistics(self, container):
60        state_stats = {INITIALIZED:0, STARTED:0, PAID:0, SUBMITTED:0,
61            ADMITTED:0, NOT_ADMITTED:0, CREATED:0}
62        faculty_keys = grok.getSite()['faculties'].keys()
63        fac_stats = dict([(i,0) for i in faculty_keys])
64        for key in container.keys():
65            state = container[key].state
66            state_stats[state] += 1
67            cert = getattr(container[key],'course1',None)
68            if  cert is not None and state == SUBMITTED:
69                faculty = cert.__parent__.__parent__.__parent__
70                fac_stats[faculty.__name__] += 1
71        return state_stats, fac_stats
Note: See TracBrowser for help on using the repository browser.