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

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

Customize StudentStudyLevel?, StudentStudyCourse? and CourseTicket? classes.

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