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