source: main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py @ 8051

Last change on this file since 8051 was 8051, checked in by Henrik Bettermann, 13 years ago

Configure application forms for postgraduate students.

  • Property svn:keywords set to Id
File size: 6.8 KB
Line 
1## $Id: interfaces.py 8051 2012-04-06 09:20:11Z henrik $
2##
3## Copyright (C) 2011 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"""Customized interfaces of the university application package.
19"""
20
21from zope import schema
22from waeup.kofa.applicants.interfaces import (
23    IApplicant, IApplicantProcessData,
24    AppCatCertificateSource, CertificateSource)
25from waeup.kofa.schoolgrades import ResultEntryField
26from waeup.kofa.interfaces import SimpleKofaVocabulary
27from waeup.uniben.interfaces import MessageFactory as _
28
29high_qual = SimpleKofaVocabulary(
30    ('National Certificate of Education','nce'),
31    ('Pre Degree Programme','pre'),
32    ('Diploma Programme','dip'),
33    ('Ordinary National Diploma','ond'),
34    ('Bachelors Degree','bd'),
35    ('Masters Degree','md'),
36    ('Professional Qualification','pq'),
37    ('Other Certification','oc'),
38    ('Higher National Diploma','hnd'),
39    ('NCE AL OTH','nce_al_oth'),
40    ('National Defence Academy','nda'),
41    ('Awaiting Results','a_rslt'),
42    ('RMC','rmc'),
43    )
44
45high_grade = SimpleKofaVocabulary(
46    ('Upper Credit','upper_credit'),
47    ('Distinction','distinction'),
48    ('Credit','credit'),
49    ('Merit','merit'),
50    ('Lower Credit','lower_credit'),
51    ('First Class','first_class'),
52    ('Second Class Upper','second_class_upper'),
53    ('Second Class Lower','second_class_lower'),
54    ('Third Class','third_class'),
55    ('Pass','pass'),
56    ('Awaiting Results','a_rslt'),
57    ('A Levels','al'),
58    )
59
60exam_types = SimpleKofaVocabulary(
61    ('SSCE','ssce'),
62    ('WAEC','waec'),
63    ('GCE O\' LEVEL','gce_o_level'),
64    ('TC II','tc_ii'),
65    ('RSA','rsa'),
66    ('NABTEB','nabteb'),
67    ('NECO','neco'),
68    ('ACE','ace'),
69    ('GCE A\' LEVEL','gce_a_level'),
70    ('IGCSE','igcse'),
71    )
72
73
74class IUGApplicant(IApplicant):
75    """An undergraduate applicant.
76
77    """
78
79class IPGApplicant(IApplicant):
80    """A postgraduate applicant.
81
82    """
83
84    perm_address = schema.Text(
85        title = _(u'Permanent Address'),
86        required = False,
87        )
88    course1 = schema.Choice(
89        title = _(u'1st Choice Course of Study'),
90        source = AppCatCertificateSource(),
91        required = True,
92        )
93    course2 = schema.Choice(
94        title = _(u'2nd Choice Course of Study'),
95        source = AppCatCertificateSource(),
96        required = False,
97        )
98    hq_type = schema.Choice(
99        title = _(u'Qualification Obtained'),
100        required = False,
101        readonly = False,
102        vocabulary = high_qual,
103        )
104    hq_matric_no = schema.TextLine(
105        title = _(u'Former Matric Number'),
106        required = False,
107        readonly = False,
108        )
109    hq_degree = schema.Choice(
110        title = _(u'Class of Degree'),
111        required = False,
112        readonly = False,
113        vocabulary = high_grade,
114        )
115    hq_school = schema.TextLine(
116        title = _(u'Institution Attended'),
117        required = False,
118        readonly = False,
119        )
120    hq_session = schema.TextLine(
121        title = _(u'Years Attended'),
122        required = False,
123        readonly = False,
124        )
125    hq_disc = schema.TextLine(
126        title = _(u'Discipline'),
127        required = False,
128        readonly = False,
129        )
130    pp_school = schema.Choice(
131        title = _(u'Qualification Obtained'),
132        required = False,
133        readonly = False,
134        vocabulary = exam_types,
135        )
136    employer = schema.TextLine(
137        title = _(u'Employer'),
138        required = False,
139        readonly = False,
140        )
141    emp_position = schema.TextLine(
142        title = _(u'Employer Position'),
143        required = False,
144        readonly = False,
145        )
146    emp_start = schema.Date(
147        title = _(u'Start Date'),
148        required = False,
149        readonly = False,
150        )
151    emp_end = schema.Date(
152        title = _(u'End Date'),
153        required = False,
154        readonly = False,
155        )
156    emp_reason = schema.TextLine(
157        title = _(u'Reason for Leaving'),
158        required = False,
159        readonly = False,
160        )
161    employer2 = schema.TextLine(
162        title = _(u'2nd Employer'),
163        required = False,
164        readonly = False,
165        )
166    emp2_position = schema.TextLine(
167        title = _(u'2nd Employer Position'),
168        required = False,
169        readonly = False,
170        )
171    emp2_start = schema.Date(
172        title = _(u'Start Date'),
173        required = False,
174        readonly = False,
175        )
176    emp2_end = schema.Date(
177        title = _(u'End Date'),
178        required = False,
179        readonly = False,
180        )
181    emp2_reason = schema.TextLine(
182        title = _(u'Reason for Leaving'),
183        required = False,
184        readonly = False,
185        )
186    notice = schema.Text(
187        title = _(u'Notice'),
188        required = False,
189        readonly = False,
190        )
191    screening_venue = schema.TextLine(
192        title = _(u'Screening Venue'),
193        required = False,
194        readonly = False,
195        )
196    screening_score = schema.Int(
197        title = _(u'Screening Score'),
198        required = False,
199        readonly = False,
200        )
201    course_admitted = schema.Choice(
202        title = _(u'Admitted Course of Study'),
203        source = CertificateSource(),
204        required = False,
205        readonly = False,
206        )
207
208
209IPGApplicant[
210    'student_id'].order =  IPGApplicant['notice'].order
211
212class IApplicant(IUGApplicant,IPGApplicant):
213    """An interface for both types of applicants.
214
215    """
216
217class IUGApplicantEdit(IUGApplicant):
218    """An undergraduate applicant interface for editing.
219
220    Here we can repeat the fields from base data and set the
221    `required` and `readonly` attributes to True to further restrict
222    the data access. Or we can allow only certain certificates to be
223    selected by choosing the appropriate source.
224
225    We cannot omit fields here. This has to be done in the
226    respective form page.
227    """
228
229class IPGApplicantEdit(IPGApplicant):
230    """A postgraduate applicant interface for editing.
231
232    Here we can repeat the fields from base data and set the
233    `required` and `readonly` attributes to True to further restrict
234    the data access. Or we can allow only certain certificates to be
235    selected by choosing the appropriate source.
236
237    We cannot omit fields here. This has to be done in the
238    respective form page.
239    """
Note: See TracBrowser for help on using the repository browser.