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