source: main/waeup.aaue/trunk/src/waeup/aaue/interfaces.py @ 8449

Last change on this file since 8449 was 8444, checked in by Henrik Bettermann, 13 years ago

Rename uniben to aaue.

  • Property svn:keywords set to Id
File size: 4.1 KB
RevLine 
[7419]1## $Id: interfaces.py 8444 2012-05-14 10:04:25Z henrik $
[6923]2##
[7419]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##
[7695]18
19import zope.i18nmessageid
[6923]20from zope import schema
[8071]21from waeup.kofa.interfaces import (SimpleKofaVocabulary,
[7505]22    ISessionConfiguration, academic_sessions_vocab)
[8444]23from waeup.aaue.utils.lgas import LGAS
[6923]24
[8441]25_ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.custom')
[7695]26
[8101]27high_qual = SimpleKofaVocabulary(
28    ('National Certificate of Education','nce'),
29    ('Pre Degree Programme','pre'),
30    ('Diploma Programme','dip'),
31    ('Ordinary National Diploma','ond'),
32    ('Bachelors Degree','bd'),
33    ('Masters Degree','md'),
34    ('Professional Qualification','pq'),
35    ('Other Certification','oc'),
36    ('Higher National Diploma','hnd'),
37    ('NCE AL OTH','nce_al_oth'),
38    ('National Defence Academy','nda'),
39    ('Awaiting Results','a_rslt'),
40    ('RMC','rmc'),
41    )
42
43high_grade = SimpleKofaVocabulary(
44    ('Upper Credit','upper_credit'),
45    ('Distinction','distinction'),
46    ('Credit','credit'),
47    ('Merit','merit'),
48    ('Lower Credit','lower_credit'),
49    ('First Class','first_class'),
50    ('Second Class Upper','second_class_upper'),
51    ('Second Class Lower','second_class_lower'),
52    ('Third Class','third_class'),
53    ('Pass','pass'),
54    ('Awaiting Results','a_rslt'),
55    ('A Levels','al'),
56    )
57
58exam_types = SimpleKofaVocabulary(
59    ('SSCE','ssce'),
60    ('WAEC','waec'),
61    ('GCE O\' LEVEL','gce_o_level'),
62    ('TC II','tc_ii'),
63    ('RSA','rsa'),
64    ('NABTEB','nabteb'),
65    ('NECO','neco'),
66    ('ACE','ace'),
67    ('GCE A\' LEVEL','gce_a_level'),
68    ('IGCSE','igcse'),
69    )
70
71
[8071]72lgas_vocab = SimpleKofaVocabulary(
73    *sorted([(x[1],x[0]) for x in LGAS]))
74
[7021]75# It's recommended to replicate all fields from the base package here.
[8204]76class ICustomSessionConfiguration(ISessionConfiguration):
[6923]77    """A session configuration object.
78    """
79
[7880]80    # Base fees, do not remove.
81
[7928]82    school_fee_base = schema.Float(
[7695]83        title = _(u'School Fee (ignored)'),
[7928]84        default = 0.0,
[7880]85        required = False,
[6923]86        )
87
[8263]88    application_fee = schema.Float(
89        title = _(u'Application Fee'),
[7928]90        default = 0.0,
[7880]91        required = False,
[6923]92        )
93
[7928]94    clearance_fee = schema.Float(
[8294]95        title = _(u'Clearance Fee (ignored)'),
[7928]96        default = 0.0,
[7880]97        required = False,
[6923]98        )
99
[7928]100    booking_fee = schema.Float(
[7695]101        title = _(u'Booking Fee'),
[7928]102        default = 0.0,
[7880]103        required = False,
[6923]104        )
105
[8441]106    # Additional fees in custom package
[7880]107
[7928]108    maint_fee = schema.Float(
[8294]109        title = _(u'Maintenance Fee (ignored)'),
[7928]110        default = 0.0,
[7880]111        required = False,
[6950]112        )
113
[7928]114    gown = schema.Float(
[7695]115        title = _(u'Gown Fee'),
[7928]116        default = 0.0,
[7880]117        required = False,
[7021]118        )
119
[7928]120    transfer = schema.Float(
[7695]121        title = _(u'Transfer Fee'),
[7928]122        default = 0.0,
[7880]123        required = False,
[7021]124        )
125
[6923]126    def getSessionString():
127        """Returns the session string from the vocabulary.
128        """
129
130
[8253]131class ICustomSessionConfigurationAdd(ICustomSessionConfiguration):
[6923]132    """A session configuration object in add mode.
133    """
134
135    academic_session = schema.Choice(
[7695]136        title = _(u'Academic Session'),
[6923]137        source = academic_sessions_vocab,
138        default = None,
139        required = True,
140        readonly = False,
141        )
142
[8204]143ICustomSessionConfigurationAdd[
144    'academic_session'].order =  ICustomSessionConfiguration[
[6923]145    'academic_session'].order
Note: See TracBrowser for help on using the repository browser.