1 | ## $Id: interfaces.py 8072 2012-04-09 07:53:53Z 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.students.vocabularies import nats_vocab |
---|
22 | from waeup.kofa.students.interfaces import ( |
---|
23 | IStudentBase,IUGStudentClearance,IPGStudentClearance, |
---|
24 | IStudentPersonal,IStudentNavigation, |
---|
25 | ) |
---|
26 | from waeup.kofa.students.vocabularies import ( |
---|
27 | nats_vocab, contextual_reg_num_source) |
---|
28 | from waeup.custom.interfaces import lgas_vocab |
---|
29 | from waeup.custom.interfaces import MessageFactory as _ |
---|
30 | |
---|
31 | class IStudentBase(IStudentBase): |
---|
32 | """Representation of student base data. |
---|
33 | |
---|
34 | """ |
---|
35 | |
---|
36 | reg_number = TextLineChoice( |
---|
37 | title = _(u'Registration Number'), |
---|
38 | required = False, |
---|
39 | readonly = False, |
---|
40 | source = contextual_reg_num_source, |
---|
41 | ) |
---|
42 | |
---|
43 | class IStudentPersonal(IStudentPersonal): |
---|
44 | """Student personal data. |
---|
45 | |
---|
46 | """ |
---|
47 | |
---|
48 | marit_stat = schema.Choice( |
---|
49 | title = u'Maritual Status', |
---|
50 | default = 'unmarried', |
---|
51 | required = False, |
---|
52 | vocabulary = SimpleKofaVocabulary( |
---|
53 | (_('Unmarried'), 'unmarried'), |
---|
54 | (_('Married'), 'married'),) |
---|
55 | ) |
---|
56 | |
---|
57 | class IUGStudentClearance(IUGStudentClearance): |
---|
58 | """Representation of ug student clearance data. |
---|
59 | |
---|
60 | """ |
---|
61 | date_of_birth = schema.Date( |
---|
62 | title = _(u'Date of Birth'), |
---|
63 | required = False, |
---|
64 | ) |
---|
65 | |
---|
66 | nationality = schema.Choice( |
---|
67 | source = nats_vocab, |
---|
68 | title = _(u'Nationality'), |
---|
69 | required = False, |
---|
70 | ) |
---|
71 | |
---|
72 | lga = schema.Choice( |
---|
73 | source = lgas_vocab, |
---|
74 | title = _(u'State/LGA (Nigerians only)'), |
---|
75 | required = False, |
---|
76 | ) |
---|
77 | |
---|
78 | class IPGStudentClearance(IUGStudentClearance): |
---|
79 | """Representation of pg student clearance data. |
---|
80 | |
---|
81 | """ |
---|
82 | |
---|
83 | class IStudent(IStudentBase,IUGStudentClearance,IPGStudentClearance,IStudentPersonal): |
---|
84 | """Representation of a student. |
---|
85 | |
---|
86 | """ |
---|