1 | ## $Id: interfaces.py 8444 2012-05-14 10:04:25Z 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 |
|
---|
19 | import zope.i18nmessageid
|
---|
20 | from zope import schema
|
---|
21 | from waeup.kofa.interfaces import (SimpleKofaVocabulary,
|
---|
22 | ISessionConfiguration, academic_sessions_vocab)
|
---|
23 | from waeup.aaue.utils.lgas import LGAS
|
---|
24 |
|
---|
25 | _ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.custom')
|
---|
26 |
|
---|
27 | high_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 |
|
---|
43 | high_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 |
|
---|
58 | exam_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 |
|
---|
72 | lgas_vocab = SimpleKofaVocabulary(
|
---|
73 | *sorted([(x[1],x[0]) for x in LGAS]))
|
---|
74 |
|
---|
75 | # It's recommended to replicate all fields from the base package here.
|
---|
76 | class ICustomSessionConfiguration(ISessionConfiguration):
|
---|
77 | """A session configuration object.
|
---|
78 | """
|
---|
79 |
|
---|
80 | # Base fees, do not remove.
|
---|
81 |
|
---|
82 | school_fee_base = schema.Float(
|
---|
83 | title = _(u'School Fee (ignored)'),
|
---|
84 | default = 0.0,
|
---|
85 | required = False,
|
---|
86 | )
|
---|
87 |
|
---|
88 | application_fee = schema.Float(
|
---|
89 | title = _(u'Application Fee'),
|
---|
90 | default = 0.0,
|
---|
91 | required = False,
|
---|
92 | )
|
---|
93 |
|
---|
94 | clearance_fee = schema.Float(
|
---|
95 | title = _(u'Clearance Fee (ignored)'),
|
---|
96 | default = 0.0,
|
---|
97 | required = False,
|
---|
98 | )
|
---|
99 |
|
---|
100 | booking_fee = schema.Float(
|
---|
101 | title = _(u'Booking Fee'),
|
---|
102 | default = 0.0,
|
---|
103 | required = False,
|
---|
104 | )
|
---|
105 |
|
---|
106 | # Additional fees in custom package
|
---|
107 |
|
---|
108 | maint_fee = schema.Float(
|
---|
109 | title = _(u'Maintenance Fee (ignored)'),
|
---|
110 | default = 0.0,
|
---|
111 | required = False,
|
---|
112 | )
|
---|
113 |
|
---|
114 | gown = schema.Float(
|
---|
115 | title = _(u'Gown Fee'),
|
---|
116 | default = 0.0,
|
---|
117 | required = False,
|
---|
118 | )
|
---|
119 |
|
---|
120 | transfer = schema.Float(
|
---|
121 | title = _(u'Transfer Fee'),
|
---|
122 | default = 0.0,
|
---|
123 | required = False,
|
---|
124 | )
|
---|
125 |
|
---|
126 | def getSessionString():
|
---|
127 | """Returns the session string from the vocabulary.
|
---|
128 | """
|
---|
129 |
|
---|
130 |
|
---|
131 | class ICustomSessionConfigurationAdd(ICustomSessionConfiguration):
|
---|
132 | """A session configuration object in add mode.
|
---|
133 | """
|
---|
134 |
|
---|
135 | academic_session = schema.Choice(
|
---|
136 | title = _(u'Academic Session'),
|
---|
137 | source = academic_sessions_vocab,
|
---|
138 | default = None,
|
---|
139 | required = True,
|
---|
140 | readonly = False,
|
---|
141 | )
|
---|
142 |
|
---|
143 | ICustomSessionConfigurationAdd[
|
---|
144 | 'academic_session'].order = ICustomSessionConfiguration[
|
---|
145 | 'academic_session'].order |
---|