1 | ## $Id: interfaces.py 11864 2014-10-21 08:10:34Z 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 | |
---|
19 | from zope import schema |
---|
20 | from kofacustom.nigeria.students.interfaces import ( |
---|
21 | INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, |
---|
22 | INigeriaStudentPersonal, INigeriaStudentStudyLevel, |
---|
23 | INigeriaStudentStudyCourse, INigeriaCourseTicket, |
---|
24 | INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo, |
---|
25 | ) |
---|
26 | from waeup.kwarapoly.payments.interfaces import ICustomOnlinePayment |
---|
27 | from waeup.kwarapoly.interfaces import MessageFactory as _ |
---|
28 | |
---|
29 | class ICustomStudentBase(INigeriaStudentBase): |
---|
30 | """Representation of student base data. |
---|
31 | |
---|
32 | """ |
---|
33 | |
---|
34 | class ICustomStudentPersonal(INigeriaStudentPersonal): |
---|
35 | """Student personal data. |
---|
36 | |
---|
37 | """ |
---|
38 | |
---|
39 | perm_address = schema.Text( |
---|
40 | title = _(u'Home Address'), |
---|
41 | required = False, |
---|
42 | ) |
---|
43 | |
---|
44 | corr_address = schema.Text( |
---|
45 | title = _(u'Correspondence Address'), |
---|
46 | required = False, |
---|
47 | ) |
---|
48 | |
---|
49 | sponsor_name = schema.TextLine( |
---|
50 | title = _(u'Sponsor\'s Name'), |
---|
51 | required = False, |
---|
52 | readonly = False, |
---|
53 | ) |
---|
54 | |
---|
55 | sponsor_address = schema.Text( |
---|
56 | title = _(u'Sponsor\'s Address'), |
---|
57 | required = False, |
---|
58 | readonly = False, |
---|
59 | ) |
---|
60 | |
---|
61 | class ICustomStudentPersonalEdit(ICustomStudentPersonal): |
---|
62 | """Interface for editing personal data by students. |
---|
63 | |
---|
64 | Here we can repeat the fields from IStudentPersonal and set the |
---|
65 | `required` if necessary. |
---|
66 | """ |
---|
67 | |
---|
68 | perm_address = schema.Text( |
---|
69 | title = _(u'Home Address'), |
---|
70 | required = True, |
---|
71 | ) |
---|
72 | |
---|
73 | corr_address = schema.Text( |
---|
74 | title = _(u'Correspondence Address'), |
---|
75 | required = True, |
---|
76 | ) |
---|
77 | |
---|
78 | sponsor_name = schema.TextLine( |
---|
79 | title = _(u'Sponsor\'s Name'), |
---|
80 | required = False, |
---|
81 | readonly = False, |
---|
82 | ) |
---|
83 | |
---|
84 | sponsor_address = schema.Text( |
---|
85 | title = _(u'Sponsor\'s Address'), |
---|
86 | required = False, |
---|
87 | readonly = False, |
---|
88 | ) |
---|
89 | |
---|
90 | class ICustomUGStudentClearance(INigeriaUGStudentClearance): |
---|
91 | """Representation of ug student clearance data. |
---|
92 | |
---|
93 | """ |
---|
94 | |
---|
95 | fst_sit_pin = schema.TextLine( |
---|
96 | title = _(u'Result Checking PIN'), |
---|
97 | required = False, |
---|
98 | readonly = False, |
---|
99 | ) |
---|
100 | |
---|
101 | fst_sit_pin_serial = schema.TextLine( |
---|
102 | title = _(u'PIN Serial Number'), |
---|
103 | required = False, |
---|
104 | readonly = False, |
---|
105 | ) |
---|
106 | |
---|
107 | scd_sit_pin = schema.TextLine( |
---|
108 | title = _(u'Result Checking PIN'), |
---|
109 | required = False, |
---|
110 | readonly = False, |
---|
111 | ) |
---|
112 | |
---|
113 | scd_sit_pin_serial = schema.TextLine( |
---|
114 | title = _(u'PIN Serial Number'), |
---|
115 | required = False, |
---|
116 | readonly = False, |
---|
117 | ) |
---|
118 | |
---|
119 | ICustomUGStudentClearance['fst_sit_pin'].order = ICustomUGStudentClearance[ |
---|
120 | 'fst_sit_results'].order |
---|
121 | ICustomUGStudentClearance['fst_sit_pin_serial'].order = ICustomUGStudentClearance[ |
---|
122 | 'fst_sit_results'].order |
---|
123 | ICustomUGStudentClearance['scd_sit_pin'].order = ICustomUGStudentClearance[ |
---|
124 | 'scd_sit_results'].order |
---|
125 | ICustomUGStudentClearance['scd_sit_pin_serial'].order = ICustomUGStudentClearance[ |
---|
126 | 'scd_sit_results'].order |
---|
127 | |
---|
128 | |
---|
129 | class ICustomPGStudentClearance(INigeriaPGStudentClearance): |
---|
130 | """Representation of pg student clearance data. |
---|
131 | |
---|
132 | """ |
---|
133 | |
---|
134 | |
---|
135 | class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance, |
---|
136 | ICustomPGStudentClearance,ICustomStudentPersonal): |
---|
137 | """Representation of a student. |
---|
138 | |
---|
139 | """ |
---|
140 | |
---|
141 | class ICustomStudentStudyCourse(INigeriaStudentStudyCourse): |
---|
142 | """A container for student study levels. |
---|
143 | |
---|
144 | """ |
---|
145 | |
---|
146 | class ICustomStudentStudyLevel(INigeriaStudentStudyLevel): |
---|
147 | """A container for course tickets. |
---|
148 | |
---|
149 | """ |
---|
150 | |
---|
151 | class ICustomStudentOnlinePayment(ICustomOnlinePayment): |
---|
152 | """A student payment via payment gateways. |
---|
153 | |
---|
154 | This Interface does not inherit from IStudentOnlinePayment. |
---|
155 | Thus all fields from IStudentOnlinePayment have to be repeated here. |
---|
156 | """ |
---|
157 | |
---|
158 | p_current = schema.Bool( |
---|
159 | title = _(u'Current Session Payment'), |
---|
160 | default = True, |
---|
161 | required = False, |
---|
162 | ) |
---|
163 | |
---|
164 | p_level = schema.Int( |
---|
165 | title = _(u'Payment Level'), |
---|
166 | required = False, |
---|
167 | ) |
---|
168 | |
---|
169 | ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[ |
---|
170 | 'p_session'].order |
---|
171 | |
---|
172 | class ICustomCourseTicket(INigeriaCourseTicket): |
---|
173 | """A course ticket. |
---|
174 | |
---|
175 | """ |
---|
176 | |
---|
177 | class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): |
---|
178 | """Representation of a student. Skip regular reg_number validation. |
---|
179 | |
---|
180 | """ |
---|
181 | |
---|
182 | class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo): |
---|
183 | """Representation of a student. Skip regular matric_number validation. |
---|
184 | |
---|
185 | """ |
---|