[16717] | 1 | ## $Id: interfaces.py 17921 2024-09-09 14:28:55Z henrik $ |
---|
[15614] | 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 | |
---|
| 19 | from zope import schema |
---|
| 20 | from waeup.kofa.students.vocabularies import StudyLevelSource |
---|
[17921] | 21 | from waeup.kofa.interfaces import ( |
---|
| 22 | IKofaObject, academic_sessions_vocab, validate_email) |
---|
[15614] | 23 | from kofacustom.nigeria.students.interfaces import ( |
---|
| 24 | INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, |
---|
| 25 | INigeriaStudentPersonal, INigeriaStudentStudyLevel, |
---|
| 26 | INigeriaStudentStudyCourse, INigeriaCourseTicket, |
---|
| 27 | INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo, |
---|
| 28 | ) |
---|
[16721] | 29 | from kofacustom.unidel.payments.interfaces import ICustomOnlinePayment |
---|
| 30 | from kofacustom.unidel.interfaces import MessageFactory as _ |
---|
[15614] | 31 | |
---|
| 32 | class ICustomStudentBase(INigeriaStudentBase): |
---|
| 33 | """Representation of student base data. |
---|
| 34 | |
---|
| 35 | """ |
---|
| 36 | |
---|
[17921] | 37 | email2 = schema.ASCIILine( |
---|
| 38 | title = _(u'Institution Email'), |
---|
| 39 | required = False, |
---|
| 40 | constraint=validate_email, |
---|
| 41 | ) |
---|
| 42 | |
---|
| 43 | ICustomStudentBase['email2'].order = ICustomStudentBase[ |
---|
| 44 | 'phone'].order |
---|
| 45 | |
---|
[15614] | 46 | class ICustomStudentPersonal(INigeriaStudentPersonal): |
---|
| 47 | """Student personal data. |
---|
| 48 | |
---|
| 49 | """ |
---|
| 50 | |
---|
| 51 | class ICustomUGStudentClearance(INigeriaUGStudentClearance): |
---|
| 52 | """Representation of ug student clearance data. |
---|
| 53 | |
---|
| 54 | """ |
---|
| 55 | |
---|
| 56 | class ICustomPGStudentClearance(INigeriaPGStudentClearance): |
---|
| 57 | """Representation of pg student clearance data. |
---|
| 58 | |
---|
| 59 | """ |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance, |
---|
| 63 | ICustomPGStudentClearance,ICustomStudentPersonal): |
---|
| 64 | """Representation of a student. |
---|
| 65 | |
---|
| 66 | """ |
---|
| 67 | |
---|
| 68 | class ICustomStudentStudyCourse(INigeriaStudentStudyCourse): |
---|
| 69 | """A container for student study levels. |
---|
| 70 | |
---|
| 71 | """ |
---|
| 72 | |
---|
| 73 | class ICustomStudentStudyLevel(INigeriaStudentStudyLevel): |
---|
| 74 | """A container for course tickets. |
---|
| 75 | |
---|
| 76 | """ |
---|
| 77 | |
---|
[16949] | 78 | total_credits_s1 = schema.Int( |
---|
| 79 | title = _(u'1st Semester Credits'), |
---|
| 80 | required = False, |
---|
| 81 | ) |
---|
| 82 | |
---|
| 83 | total_credits_s2 = schema.Int( |
---|
| 84 | title = _(u'2nd Semester Credits'), |
---|
| 85 | required = False, |
---|
| 86 | ) |
---|
| 87 | |
---|
| 88 | total_credits = schema.Int( |
---|
| 89 | title = _(u'Total Credits'), |
---|
| 90 | required = False, |
---|
| 91 | ) |
---|
| 92 | |
---|
[15614] | 93 | class ICustomStudentOnlinePayment(ICustomOnlinePayment): |
---|
| 94 | """A student payment via payment gateways. |
---|
| 95 | |
---|
| 96 | This Interface does not inherit from IStudentOnlinePayment. |
---|
| 97 | Thus all fields from IStudentOnlinePayment have to be repeated here. |
---|
| 98 | """ |
---|
| 99 | |
---|
| 100 | p_current = schema.Bool( |
---|
| 101 | title = _(u'Current Session Payment'), |
---|
| 102 | default = True, |
---|
| 103 | required = False, |
---|
| 104 | ) |
---|
| 105 | |
---|
| 106 | p_level = schema.Choice( |
---|
| 107 | title = _(u'Payment Level'), |
---|
| 108 | source = StudyLevelSource(), |
---|
| 109 | required = False, |
---|
| 110 | ) |
---|
| 111 | |
---|
| 112 | ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[ |
---|
| 113 | 'p_session'].order |
---|
| 114 | |
---|
| 115 | class ICustomCourseTicket(INigeriaCourseTicket): |
---|
| 116 | """A course ticket. |
---|
| 117 | |
---|
| 118 | """ |
---|
| 119 | |
---|
[17025] | 120 | score = schema.Int( |
---|
| 121 | title = _(u'Score'), |
---|
| 122 | required = False, |
---|
| 123 | readonly = False, |
---|
| 124 | max = 100, |
---|
| 125 | ) |
---|
| 126 | |
---|
| 127 | ca = schema.Int( |
---|
| 128 | title = _(u'CA'), |
---|
| 129 | default = None, |
---|
| 130 | required = False, |
---|
| 131 | missing_value = None, |
---|
| 132 | max = 90, |
---|
| 133 | ) |
---|
| 134 | |
---|
| 135 | ICustomCourseTicket['score'].order = INigeriaCourseTicket['score'].order |
---|
| 136 | ICustomCourseTicket['ca'].order = ICustomCourseTicket['score'].order |
---|
| 137 | |
---|
| 138 | class ICustomCourseTicketImport(ICustomCourseTicket): |
---|
| 139 | """An interface for importing course results and nothing more. |
---|
| 140 | """ |
---|
| 141 | |
---|
| 142 | score = schema.Int( |
---|
| 143 | title = _(u'Score'), |
---|
| 144 | required = False, |
---|
| 145 | readonly = False, |
---|
| 146 | max = 100, |
---|
| 147 | ) |
---|
| 148 | |
---|
| 149 | ca = schema.Int( |
---|
| 150 | title = _(u'CA'), |
---|
| 151 | required = False, |
---|
| 152 | readonly = False, |
---|
| 153 | max = 90, |
---|
| 154 | ) |
---|
| 155 | |
---|
| 156 | level_session = schema.Choice( |
---|
| 157 | title = _(u'Level Session'), |
---|
| 158 | source = academic_sessions_vocab, |
---|
| 159 | required = False, |
---|
| 160 | readonly = False, |
---|
| 161 | ) |
---|
| 162 | |
---|
| 163 | |
---|
[15614] | 164 | class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): |
---|
| 165 | """Representation of a student. Skip regular reg_number validation. |
---|
| 166 | |
---|
| 167 | """ |
---|
| 168 | |
---|
| 169 | class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo): |
---|
| 170 | """Representation of a student. Skip regular matric_number validation. |
---|
| 171 | |
---|
| 172 | """ |
---|