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