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

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

Customize warnCreditsOOR and IStudentStudyLevel.

  • Property svn:keywords set to Id
File size: 7.8 KB
RevLine 
[7505]1## $Id: interfaces.py 14591 2017-02-25 17:59:16Z 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##
[8868]18
[7505]19from zope import schema
[10019]20from waeup.kofa.schema import FormattedDate, PhoneNumber
21from waeup.kofa.students.interfaces import IUGStudentClearance
[13738]22from waeup.kofa.students.vocabularies import nats_vocab, StudyLevelSource
[10019]23from waeup.kofa.schoolgrades import ResultEntryField
24from kofacustom.nigeria.interfaces import (
25    high_qual, high_grade, exam_types, LGASource)
[8868]26from kofacustom.nigeria.students.interfaces import (
27    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
28    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
29    INigeriaStudentStudyCourse, INigeriaCourseTicket,
30    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
[7505]31    )
[8868]32from waeup.fceokene.payments.interfaces import ICustomOnlinePayment
[8460]33from waeup.fceokene.interfaces import MessageFactory as _
[7505]34
[8868]35class ICustomStudentBase(INigeriaStudentBase):
[7618]36    """Representation of student base data.
[7505]37
38    """
[7618]39
[8868]40class ICustomStudentPersonal(INigeriaStudentPersonal):
[7618]41    """Student personal data.
42
43    """
44
[10019]45class ICustomUGStudentClearance(IUGStudentClearance):
[7995]46    """Representation of ug student clearance data.
[7505]47
[10019]48    Completely customized for FCE Okene.
49
[7505]50    """
51
[10019]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,
[14018]123        defaultFactory=list,
[10019]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,
[14018]156        defaultFactory=list,
[10019]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,
[14018]183    #    defaultFactory=list,
[10019]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
[8868]230class ICustomPGStudentClearance(INigeriaPGStudentClearance):
[7995]231    """Representation of pg student clearance data.
[7505]232
233    """
234
[8101]235
[8204]236class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
237    ICustomPGStudentClearance,ICustomStudentPersonal):
[7995]238    """Representation of a student.
[7505]239
240    """
[8247]241
[8868]242class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
[8326]243    """A container for student study levels.
244
245    """
246
[8868]247class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
[8326]248    """A container for course tickets.
249
250    """
251
[14591]252    total_credits_s1 = schema.Int(
253        title = _(u'1st Semester Credits'),
254        required = False,
255        )
256
257    total_credits_s2 = schema.Int(
258        title = _(u'2nd Semester Credits'),
259        required = False,
260        )
261
262    total_credits = schema.Int(
263        title = _(u'Total Credits'),
264        required = False,
265        )
266
[8247]267class ICustomStudentOnlinePayment(ICustomOnlinePayment):
268    """A student payment via payment gateways.
269
[8270]270    This Interface does not inherit from IStudentOnlinePayment.
271    Thus all fields from IStudentOnlinePayment have to be repeated here.
272    """
273
[9153]274    p_current = schema.Bool(
275        title = _(u'Current Session Payment'),
276        default = True,
277        required = False,
278        )
279
[13738]280    p_level = schema.Choice(
[8270]281        title = _(u'Payment Level'),
[13738]282        source = StudyLevelSource(),
[8270]283        required = False,
284        )
[8430]285
[8270]286ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
[8326]287    'p_session'].order
288
[8868]289class ICustomCourseTicket(INigeriaCourseTicket):
[8326]290    """A course ticket.
291
[8584]292    """
293
[8868]294class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
[8584]295    """Representation of a student. Skip regular reg_number validation.
296
297    """
298
[8868]299class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
[8584]300    """Representation of a student. Skip regular matric_number validation.
301
[8868]302    """
Note: See TracBrowser for help on using the repository browser.