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