[7505] | 1 | ## $Id: interfaces.py 9914 2013-01-26 11:08:25Z 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 | ## |
---|
[8867] | 18 | |
---|
[7505] | 19 | from zope import schema |
---|
[9496] | 20 | from zc.sourcefactory.contextual import BasicContextualSourceFactory |
---|
| 21 | from zope.catalog.interfaces import ICatalog |
---|
| 22 | from zope.component import getUtility |
---|
| 23 | from waeup.kofa.interfaces import IKofaObject |
---|
[8867] | 24 | from kofacustom.nigeria.students.interfaces import ( |
---|
| 25 | INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, |
---|
| 26 | INigeriaStudentPersonal, INigeriaStudentStudyLevel, |
---|
| 27 | INigeriaStudentStudyCourse, INigeriaCourseTicket, |
---|
| 28 | INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo, |
---|
[7505] | 29 | ) |
---|
[8867] | 30 | from waeup.aaue.payments.interfaces import ICustomOnlinePayment |
---|
[8444] | 31 | from waeup.aaue.interfaces import MessageFactory as _ |
---|
[7505] | 32 | |
---|
[8867] | 33 | class ICustomStudentBase(INigeriaStudentBase): |
---|
[7618] | 34 | """Representation of student base data. |
---|
[7505] | 35 | |
---|
| 36 | """ |
---|
[7618] | 37 | |
---|
[8867] | 38 | class ICustomStudentPersonal(INigeriaStudentPersonal): |
---|
[7618] | 39 | """Student personal data. |
---|
| 40 | |
---|
| 41 | """ |
---|
| 42 | |
---|
[8867] | 43 | class ICustomUGStudentClearance(INigeriaUGStudentClearance): |
---|
[7995] | 44 | """Representation of ug student clearance data. |
---|
[7505] | 45 | |
---|
| 46 | """ |
---|
| 47 | |
---|
[8867] | 48 | class ICustomPGStudentClearance(INigeriaPGStudentClearance): |
---|
[7995] | 49 | """Representation of pg student clearance data. |
---|
[7505] | 50 | |
---|
| 51 | """ |
---|
| 52 | |
---|
[8101] | 53 | |
---|
[8204] | 54 | class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance, |
---|
| 55 | ICustomPGStudentClearance,ICustomStudentPersonal): |
---|
[7995] | 56 | """Representation of a student. |
---|
[7505] | 57 | |
---|
| 58 | """ |
---|
[8247] | 59 | |
---|
[8867] | 60 | class ICustomStudentStudyCourse(INigeriaStudentStudyCourse): |
---|
[8326] | 61 | """A container for student study levels. |
---|
| 62 | |
---|
| 63 | """ |
---|
| 64 | |
---|
[8867] | 65 | class ICustomStudentStudyLevel(INigeriaStudentStudyLevel): |
---|
[8326] | 66 | """A container for course tickets. |
---|
| 67 | |
---|
| 68 | """ |
---|
| 69 | |
---|
[9914] | 70 | total_credits_s1 = schema.Int( |
---|
| 71 | title = _(u'1st Semester Units'), |
---|
| 72 | required = False, |
---|
| 73 | readonly = True, |
---|
| 74 | ) |
---|
| 75 | |
---|
| 76 | total_credits_s2 = schema.Int( |
---|
| 77 | title = _(u'2nd Semester Units'), |
---|
| 78 | required = False, |
---|
| 79 | readonly = True, |
---|
| 80 | ) |
---|
| 81 | |
---|
| 82 | gpa = schema.Int( |
---|
| 83 | title = _(u'GPA'), |
---|
| 84 | required = False, |
---|
| 85 | readonly = True, |
---|
| 86 | ) |
---|
| 87 | |
---|
[8247] | 88 | class ICustomStudentOnlinePayment(ICustomOnlinePayment): |
---|
| 89 | """A student payment via payment gateways. |
---|
| 90 | |
---|
[8270] | 91 | This Interface does not inherit from IStudentOnlinePayment. |
---|
| 92 | Thus all fields from IStudentOnlinePayment have to be repeated here. |
---|
| 93 | """ |
---|
| 94 | |
---|
[9154] | 95 | p_current = schema.Bool( |
---|
| 96 | title = _(u'Current Session Payment'), |
---|
| 97 | default = True, |
---|
| 98 | required = False, |
---|
| 99 | ) |
---|
| 100 | |
---|
[8270] | 101 | p_level = schema.Int( |
---|
| 102 | title = _(u'Payment Level'), |
---|
| 103 | required = False, |
---|
| 104 | ) |
---|
[8430] | 105 | |
---|
[8270] | 106 | ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[ |
---|
[8326] | 107 | 'p_session'].order |
---|
| 108 | |
---|
[8867] | 109 | class ICustomCourseTicket(INigeriaCourseTicket): |
---|
[8326] | 110 | """A course ticket. |
---|
| 111 | |
---|
[8583] | 112 | """ |
---|
| 113 | |
---|
[8867] | 114 | class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): |
---|
[8583] | 115 | """Representation of a student. Skip regular reg_number validation. |
---|
| 116 | |
---|
| 117 | """ |
---|
| 118 | |
---|
[8867] | 119 | class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo): |
---|
[8583] | 120 | """Representation of a student. Skip regular matric_number validation. |
---|
| 121 | |
---|
[8867] | 122 | """ |
---|