source: main/waeup.fceokene/trunk/src/waeup/fceokene/students/interfaces.py @ 14217

Last change on this file since 14217 was 14018, checked in by Henrik Bettermann, 8 years ago

Use defaultFactory.

  • Property svn:keywords set to Id
File size: 7.5 KB
Line 
1## $Id: interfaces.py 14018 2016-07-07 06:43:38Z 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
19from zope import schema
20from waeup.kofa.schema import FormattedDate, PhoneNumber
21from waeup.kofa.students.interfaces import IUGStudentClearance
22from waeup.kofa.students.vocabularies import nats_vocab, StudyLevelSource
23from waeup.kofa.schoolgrades import ResultEntryField
24from kofacustom.nigeria.interfaces import (
25    high_qual, high_grade, exam_types, LGASource)
26from kofacustom.nigeria.students.interfaces import (
27    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
28    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
29    INigeriaStudentStudyCourse, INigeriaCourseTicket,
30    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
31    )
32from waeup.fceokene.payments.interfaces import ICustomOnlinePayment
33from waeup.fceokene.interfaces import MessageFactory as _
34
35class ICustomStudentBase(INigeriaStudentBase):
36    """Representation of student base data.
37
38    """
39
40class ICustomStudentPersonal(INigeriaStudentPersonal):
41    """Student personal data.
42
43    """
44
45class ICustomUGStudentClearance(IUGStudentClearance):
46    """Representation of ug student clearance data.
47
48    Completely customized for FCE Okene.
49
50    """
51
52    officer_comment = schema.Text(
53        title = _(u"Officer's Comment"),
54        required = False,
55        )
56
57    clearance_locked = schema.Bool(
58        title = _(u'Clearance form locked'),
59        default = False,
60        required = False,
61        )
62
63    clr_code = schema.TextLine(
64        title = _(u'CLR Activation Code'),
65        required = False,
66        readonly = False,
67        )
68
69    date_of_birth = FormattedDate(
70        title = _(u'Date of Birth'),
71        required = False,
72        show_year = True,
73        )
74
75    nationality = schema.Choice(
76        source = nats_vocab,
77        title = _(u'Nationality'),
78        required = True,
79        )
80
81    lga = schema.Choice(
82        source = LGASource(),
83        title = _(u'State/LGA (Nigerians only)'),
84        required = False,
85        )
86
87    def_adm = schema.Bool(
88        title = _(u'Deferent of Admission'),
89        required = False,
90        readonly = False,
91        )
92
93    fst_sit_fname = schema.TextLine(
94        title = _(u'Full Name'),
95        required = False,
96        readonly = False,
97        )
98    fst_sit_no = schema.TextLine(
99        title = _(u'Exam Number'),
100        required = False,
101        readonly = False,
102        )
103
104    fst_sit_date = FormattedDate(
105        title = _(u'Exam Date'),
106        required = False,
107        readonly = False,
108        show_year = True,
109        )
110
111    fst_sit_type = schema.Choice(
112        title = _(u'Exam Type'),
113        required = False,
114        readonly = False,
115        vocabulary = exam_types,
116        )
117
118    fst_sit_results = schema.List(
119        title = _(u'Exam Results'),
120        value_type = ResultEntryField(),
121        required = False,
122        readonly = False,
123        defaultFactory=list,
124        )
125
126    scd_sit_fname = schema.TextLine(
127        title = _(u'Full Name'),
128        required = False,
129        readonly = False,
130        )
131    scd_sit_no = schema.TextLine(
132        title = _(u'Exam Number'),
133        required = False,
134        readonly = False,
135        )
136
137    scd_sit_date = FormattedDate(
138        title = _(u'Exam Date'),
139        required = False,
140        readonly = False,
141        show_year = True,
142        )
143
144    scd_sit_type = schema.Choice(
145        title = _(u'Exam Type'),
146        required = False,
147        readonly = False,
148        vocabulary = exam_types,
149        )
150
151    scd_sit_results = schema.List(
152        title = _(u'Exam Results'),
153        value_type = ResultEntryField(),
154        required = False,
155        readonly = False,
156        defaultFactory=list,
157        )
158
159    #alr_fname = schema.TextLine(
160    #    title = _(u'Full Name'),
161    #    required = False,
162    #    readonly = False,
163    #    )
164
165    #alr_no = schema.TextLine(
166    #    title = _(u'Exam Number'),
167    #    required = False,
168    #    readonly = False,
169    #    )
170
171    #alr_date = FormattedDate(
172    #    title = _(u'Exam Date'),
173    #    required = False,
174    #    readonly = False,
175    #    show_year = True,
176    #    )
177
178    #alr_results = schema.List(
179    #    title = _(u'Exam Results'),
180    #    value_type = ResultEntryField(),
181    #    required = False,
182    #    readonly = False,
183    #    defaultFactory=list,
184    #    )
185
186    hq_type = schema.Choice(
187        title = _(u'Qualification Obtained'),
188        required = False,
189        readonly = False,
190        vocabulary = high_qual,
191        )
192
193    hq_fname = schema.TextLine(
194        title = _(u'Full Name'),
195        required = False,
196        readonly = False,
197        )
198
199    hq_matric_no = schema.TextLine(
200        title = _(u'Former Matric Number'),
201        required = False,
202        readonly = False,
203        )
204
205    #hq_degree = schema.Choice(
206    #    title = _(u'Class of Degree'),
207    #    required = False,
208    #    readonly = False,
209    #    vocabulary = high_grade,
210    #    )
211
212    hq_school = schema.TextLine(
213        title = _(u'Institution Attended'),
214        required = False,
215        readonly = False,
216        )
217
218    hq_session = schema.TextLine(
219        title = _(u'Years Attended'),
220        required = False,
221        readonly = False,
222        )
223
224    hq_disc = schema.TextLine(
225        title = _(u'Course Combination'),
226        required = False,
227        readonly = False,
228        )
229
230class ICustomPGStudentClearance(INigeriaPGStudentClearance):
231    """Representation of pg student clearance data.
232
233    """
234
235
236class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
237    ICustomPGStudentClearance,ICustomStudentPersonal):
238    """Representation of a student.
239
240    """
241
242class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
243    """A container for student study levels.
244
245    """
246
247class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
248    """A container for course tickets.
249
250    """
251
252class ICustomStudentOnlinePayment(ICustomOnlinePayment):
253    """A student payment via payment gateways.
254
255    This Interface does not inherit from IStudentOnlinePayment.
256    Thus all fields from IStudentOnlinePayment have to be repeated here.
257    """
258
259    p_current = schema.Bool(
260        title = _(u'Current Session Payment'),
261        default = True,
262        required = False,
263        )
264
265    p_level = schema.Choice(
266        title = _(u'Payment Level'),
267        source = StudyLevelSource(),
268        required = False,
269        )
270
271ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
272    'p_session'].order
273
274class ICustomCourseTicket(INigeriaCourseTicket):
275    """A course ticket.
276
277    """
278
279class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
280    """Representation of a student. Skip regular reg_number validation.
281
282    """
283
284class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
285    """Representation of a student. Skip regular matric_number validation.
286
287    """
Note: See TracBrowser for help on using the repository browser.