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