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