[7505] | 1 | ## $Id: interfaces.py 13085 2015-06-21 11:47:55Z 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 | ## |
---|
[8865] | 18 | |
---|
[8866] | 19 | from zope import schema |
---|
[12856] | 20 | from waeup.kofa.interfaces import validate_email |
---|
[8865] | 21 | from kofacustom.nigeria.students.interfaces import ( |
---|
| 22 | INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, |
---|
[13085] | 23 | INigeriaStudentPersonal, INigeriaStudentPersonalEdit, |
---|
| 24 | INigeriaStudentStudyLevel, |
---|
[8865] | 25 | INigeriaStudentStudyCourse, INigeriaCourseTicket, |
---|
| 26 | INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo, |
---|
[7505] | 27 | ) |
---|
[8866] | 28 | from waeup.uniben.payments.interfaces import ICustomOnlinePayment |
---|
| 29 | from waeup.uniben.interfaces import MessageFactory as _ |
---|
[7505] | 30 | |
---|
[8865] | 31 | class ICustomStudentBase(INigeriaStudentBase): |
---|
[7618] | 32 | """Representation of student base data. |
---|
[7505] | 33 | """ |
---|
[7618] | 34 | |
---|
[8865] | 35 | class ICustomStudentPersonal(INigeriaStudentPersonal): |
---|
[7618] | 36 | """Student personal data. |
---|
[13085] | 37 | """ |
---|
[7618] | 38 | |
---|
[13085] | 39 | parent_email = schema.ASCIILine( |
---|
| 40 | title = _(u'Parent Email'), |
---|
| 41 | required = False, |
---|
| 42 | constraint=validate_email, |
---|
| 43 | ) |
---|
| 44 | |
---|
| 45 | class ICustomStudentPersonalEdit(INigeriaStudentPersonalEdit): |
---|
| 46 | """Interface for editing personal data by students. |
---|
[7618] | 47 | """ |
---|
| 48 | |
---|
[12856] | 49 | parent_email = schema.ASCIILine( |
---|
| 50 | title = _(u'Parent Email'), |
---|
| 51 | required = False, |
---|
| 52 | constraint=validate_email, |
---|
| 53 | ) |
---|
| 54 | |
---|
[8865] | 55 | class ICustomUGStudentClearance(INigeriaUGStudentClearance): |
---|
[7995] | 56 | """Representation of ug student clearance data. |
---|
[7505] | 57 | """ |
---|
| 58 | |
---|
[8865] | 59 | class ICustomPGStudentClearance(INigeriaPGStudentClearance): |
---|
[7995] | 60 | """Representation of pg student clearance data. |
---|
[7505] | 61 | """ |
---|
| 62 | |
---|
[12856] | 63 | class ICustomStudent(ICustomStudentBase, ICustomUGStudentClearance, |
---|
| 64 | ICustomPGStudentClearance, ICustomStudentPersonal): |
---|
[7995] | 65 | """Representation of a student. |
---|
[7505] | 66 | """ |
---|
[8247] | 67 | |
---|
[8865] | 68 | class ICustomStudentStudyCourse(INigeriaStudentStudyCourse): |
---|
[8326] | 69 | """A container for student study levels. |
---|
| 70 | """ |
---|
| 71 | |
---|
[8865] | 72 | class ICustomStudentStudyLevel(INigeriaStudentStudyLevel): |
---|
[8326] | 73 | """A container for course tickets. |
---|
| 74 | """ |
---|
| 75 | |
---|
[8866] | 76 | class ICustomStudentOnlinePayment(ICustomOnlinePayment): |
---|
[8247] | 77 | """A student payment via payment gateways. |
---|
| 78 | |
---|
[8866] | 79 | This Interface does not inherit from IStudentOnlinePayment. |
---|
| 80 | Thus all fields from IStudentOnlinePayment have to be repeated here. |
---|
[8270] | 81 | """ |
---|
| 82 | |
---|
[9152] | 83 | p_current = schema.Bool( |
---|
| 84 | title = _(u'Current Session Payment'), |
---|
| 85 | default = True, |
---|
| 86 | required = False, |
---|
| 87 | ) |
---|
| 88 | |
---|
[8866] | 89 | p_level = schema.Int( |
---|
| 90 | title = _(u'Payment Level'), |
---|
| 91 | required = False, |
---|
| 92 | ) |
---|
| 93 | |
---|
| 94 | ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[ |
---|
| 95 | 'p_session'].order |
---|
| 96 | |
---|
[8865] | 97 | class ICustomCourseTicket(INigeriaCourseTicket): |
---|
[8326] | 98 | """A course ticket. |
---|
[8582] | 99 | """ |
---|
| 100 | |
---|
[8865] | 101 | class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): |
---|
[8582] | 102 | """Representation of a student. Skip regular reg_number validation. |
---|
| 103 | """ |
---|
| 104 | |
---|
[8865] | 105 | class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo): |
---|
[8582] | 106 | """Representation of a student. Skip regular matric_number validation. |
---|
| 107 | """ |
---|