source: main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py @ 8293

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

Set p_level and p_session after school fee payment according to getReturningData.

  • Property svn:keywords set to Id
File size: 8.9 KB
Line 
1## $Id: interfaces.py 8270 2012-04-25 06:45:16Z henrik $
2##
3## Copyright (C) 2012 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##
18from zope import schema
19from waeup.kofa.schema import TextLineChoice
20from waeup.kofa.interfaces import SimpleKofaVocabulary, academic_sessions_vocab
21from waeup.kofa.schema import FormattedDate
22from waeup.kofa.schoolgrades import ResultEntryField
23from waeup.kofa.students.vocabularies import nats_vocab
24from waeup.kofa.students.interfaces import (
25    IStudentBase,IUGStudentClearance,IPGStudentClearance,
26    IStudentPersonal,IStudentNavigation,
27    )
28from waeup.kofa.students.vocabularies import (
29    nats_vocab, contextual_reg_num_source)
30from waeup.uniben.interfaces import (
31    lgas_vocab, high_qual, high_grade, exam_types)
32from waeup.uniben.interfaces import MessageFactory as _
33from waeup.uniben.payments.interfaces import ICustomOnlinePayment
34
35class ICustomStudentBase(IStudentBase):
36    """Representation of student base data.
37
38    """
39
40    reg_number = TextLineChoice(
41        title = _(u'Registration Number'),
42        required = False,
43        readonly = False,
44        source = contextual_reg_num_source,
45        )
46
47class ICustomStudentPersonal(IStudentPersonal):
48    """Student personal data.
49
50    """
51
52    marit_stat = schema.Choice(
53        title = u'Maritual Status',
54        default = 'unmarried',
55        required = False,
56        vocabulary = SimpleKofaVocabulary(
57            (_('Unmarried'), 'unmarried'),
58            (_('Married'), 'married'),)
59        )
60
61class ICustomUGStudentClearance(IUGStudentClearance):
62    """Representation of ug student clearance data.
63
64    """
65    date_of_birth = FormattedDate(
66        title = _(u'Date of Birth'),
67        required = False,
68        )
69
70    nationality = schema.Choice(
71        source = nats_vocab,
72        title = _(u'Nationality'),
73        required = False,
74        )
75
76    lga = schema.Choice(
77        source = lgas_vocab,
78        title = _(u'State/LGA (Nigerians only)'),
79        required = False,
80        )
81
82    def_adm = schema.Bool(
83        title = _(u'Deferent of Admission'),
84        required = False,
85        readonly = False,
86        )
87
88    fst_sit_fname = schema.TextLine(
89        title = _(u'Full Name'),
90        required = False,
91        readonly = False,
92        )
93    fst_sit_no = schema.TextLine(
94        title = _(u'Exam Number'),
95        required = False,
96        readonly = False,
97        )
98
99    fst_sit_date = FormattedDate(
100        title = _(u'Exam Date'),
101        required = False,
102        readonly = False,
103        )
104
105    fst_sit_type = schema.Choice(
106        title = _(u'Exam Type'),
107        required = False,
108        readonly = False,
109        vocabulary = exam_types,
110        )
111
112    fst_sit_results = schema.List(
113        title = _(u'Exam Results'),
114        value_type = ResultEntryField(),
115        required = False,
116        readonly = False,
117        default = [],
118        )
119
120    scd_sit_fname = schema.TextLine(
121        title = _(u'Full Name'),
122        required = False,
123        readonly = False,
124        )
125    scd_sit_no = schema.TextLine(
126        title = _(u'Exam Number'),
127        required = False,
128        readonly = False,
129        )
130
131    scd_sit_date = FormattedDate(
132        title = _(u'Exam Date'),
133        required = False,
134        readonly = False,
135        )
136
137    scd_sit_type = schema.Choice(
138        title = _(u'Exam Type'),
139        required = False,
140        readonly = False,
141        vocabulary = exam_types,
142        )
143
144    scd_sit_results = schema.List(
145        title = _(u'Exam Results'),
146        value_type = ResultEntryField(),
147        required = False,
148        readonly = False,
149        default = [],
150        )
151
152    alr_fname = schema.TextLine(
153        title = _(u'Full Name'),
154        required = False,
155        readonly = False,
156        )
157    alr_no = schema.TextLine(
158        title = _(u'Exam Number'),
159        required = False,
160        readonly = False,
161        )
162
163    alr_date = FormattedDate(
164        title = _(u'Exam Date'),
165        required = False,
166        readonly = False,
167        )
168
169    alr_results = schema.List(
170        title = _(u'Exam Results'),
171        value_type = ResultEntryField(),
172        required = False,
173        readonly = False,
174        default = [],
175        )
176
177    hq_type = schema.Choice(
178        title = _(u'Qualification Obtained'),
179        required = False,
180        readonly = False,
181        vocabulary = high_qual,
182        )
183
184    hq_matric_no = schema.TextLine(
185        title = _(u'Former Matric Number'),
186        required = False,
187        readonly = False,
188        )
189
190    hq_degree = schema.Choice(
191        title = _(u'Class of Degree'),
192        required = False,
193        readonly = False,
194        vocabulary = high_grade,
195        )
196
197    hq_school = schema.TextLine(
198        title = _(u'Institution Attended'),
199        required = False,
200        readonly = False,
201        )
202
203    hq_session = schema.TextLine(
204        title = _(u'Years Attended'),
205        required = False,
206        readonly = False,
207        )
208
209    hq_disc = schema.TextLine(
210        title = _(u'Discipline'),
211        required = False,
212        readonly = False,
213        )
214
215
216class ICustomPGStudentClearance(ICustomUGStudentClearance):
217    """Representation of pg student clearance data.
218
219    """
220
221    hq2_type = schema.Choice(
222        title = _(u'Qualification Obtained'),
223        required = False,
224        readonly = False,
225        vocabulary = high_qual,
226        )
227
228    hq2_matric_no = schema.TextLine(
229        title = _(u'Former Matric Number'),
230        required = False,
231        readonly = False,
232        )
233
234    hq2_degree = schema.Choice(
235        title = _(u'Class of Degree'),
236        required = False,
237        readonly = False,
238        vocabulary = high_grade,
239        )
240
241    hq2_school = schema.TextLine(
242        title = _(u'Institution Attended'),
243        required = False,
244        readonly = False,
245        )
246
247    hq2_session = schema.TextLine(
248        title = _(u'Years Attended'),
249        required = False,
250        readonly = False,
251        )
252
253    hq2_disc = schema.TextLine(
254        title = _(u'Discipline'),
255        required = False,
256        readonly = False,
257        )
258
259    nysc_year = schema.Int(
260        title = _(u'Nysc Year'),
261        required = False,
262        readonly = False,
263        )
264
265    nysc_lga = schema.Choice(
266        source = lgas_vocab,
267        title = _(u'Nysc Location'),
268        required = False,
269        )
270
271    employer = schema.TextLine(
272        title = _(u'Employer'),
273        required = False,
274        readonly = False,
275        )
276
277    emp_position = schema.TextLine(
278        title = _(u'Employer Position'),
279        required = False,
280        readonly = False,
281        )
282
283    emp_start = FormattedDate(
284        title = _(u'Start Date'),
285        required = False,
286        readonly = False,
287        )
288
289    emp_end = FormattedDate(
290        title = _(u'End Date'),
291        required = False,
292        readonly = False,
293        )
294
295    emp_reason = schema.TextLine(
296        title = _(u'Reason for Leaving'),
297        required = False,
298        readonly = False,
299        )
300
301    employer2 = schema.TextLine(
302        title = _(u'2nd Employer'),
303        required = False,
304        readonly = False,
305        )
306
307    emp2_position = schema.TextLine(
308        title = _(u'2nd Employer Position'),
309        required = False,
310        readonly = False,
311        )
312
313    emp2_start = FormattedDate(
314        title = _(u'Start Date'),
315        required = False,
316        readonly = False,
317        )
318    emp2_end = FormattedDate(
319        title = _(u'End Date'),
320        required = False,
321        readonly = False,
322        )
323
324    emp2_reason = schema.TextLine(
325        title = _(u'Reason for Leaving'),
326        required = False,
327        readonly = False,
328        )
329
330    uniben_matric = schema.TextLine(
331        title = _(u'If yes, matric number'),
332        required = False,
333        readonly = False,
334        )
335
336
337class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
338    ICustomPGStudentClearance,ICustomStudentPersonal):
339    """Representation of a student.
340
341    """
342
343class ICustomStudentOnlinePayment(ICustomOnlinePayment):
344    """A student payment via payment gateways.
345
346    This Interface does not inherit from IStudentOnlinePayment.
347    Thus all fields from IStudentOnlinePayment have to be repeated here.
348    """
349
350    p_level = schema.Int(
351        title = _(u'Payment Level'),
352        required = False,
353        readonly = True,
354        )
355ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
356    'p_session'].order
Note: See TracBrowser for help on using the repository browser.