source: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/interfaces.py @ 13945

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

PUTME is obsolete (at least at Uniben). Rename putme to ase (Admission Screening Exercise).

  • Property svn:keywords set to Id
File size: 22.4 KB
Line 
1## $Id: interfaces.py 13945 2016-06-15 10:55:25Z 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 zope.component import getUtility
23from zope.schema import getFields
24from waeup.kofa.applicants.interfaces import (
25    contextual_reg_num_source,
26    IApplicantBaseData,
27    AppCatCertificateSource, CertificateSource)
28from waeup.kofa.schoolgrades import ResultEntryField
29from waeup.kofa.interfaces import (
30    SimpleKofaVocabulary,
31    academic_sessions_vocab,
32    validate_email,
33    SubjectSource,
34    IKofaUtils)
35from waeup.kofa.schema import FormattedDate, TextLineChoice
36from waeup.kofa.students.vocabularies import nats_vocab, GenderSource
37from kofacustom.nigeria.interfaces import (
38    LGASource, high_qual, high_grade, exam_types)
39from kofacustom.nigeria.interfaces import MessageFactory as _
40from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment
41
42programme_types_vocab = SimpleKofaVocabulary(
43    (_('Post UTME'), 'putme'),
44    (_('Post DE'), 'pude'),
45    (_('Admission Screening Exercise'), 'ase'),
46    (_('not applicable'), 'na'),
47    )
48
49jambsubjects = SimpleKofaVocabulary(
50    (_('Use of English'),'english_language'),
51    (_('Agricultural Science'),'agricultural_science'),
52    (_('Arabic'),'arabic'),
53    (_('Biology'),'biology'),
54    (_('Book Keeping'),'book_keeping'),
55    (_('Chemistry'),'chemistry'),
56    (_('Christian Religious Studies'),'christian_religious_studies'),
57    (_('Commerce'),'commerce'),
58    (_('Economics'),'economics'),
59    (_('Financial Accounting'),'financial_accounting'),
60    (_('Fine Art'),'fine_art'),
61    (_('Food and Nutrition'),'food_and_nutrition'),
62    (_('French'),'french'),
63    (_('Geography'),'geography'),
64    (_('German'),'german'),
65    (_('Government'),'government'),
66    (_('Hausa'),'hausa'),
67    (_('Home Economics'),'home_economics'),
68    (_('History'),'history'),
69    (_('Igbo'),'igbo'),
70    (_('Literature in English'),'literature_in_english'),
71    (_('Literature in Nigerian Languages'),'literature_in_nigerian_languages'),
72    (_('Mathematics'),'mathematics'),
73    (_('Music'),'music'),
74    (_('Physics'),'physics'),
75    (_('Yoruba'),'yoruba'),
76    )
77
78# Define a validation method for jamb subjects
79class NotExactNumberOfItems(schema.ValidationError):
80    __doc__ = u"Not exactly 4 items selected."
81
82def four_items(value):
83    if len(value) and len(value) != 4:
84        raise NotExactNumberOfItems(value)
85    return True
86
87class JAMBSubjectSource(SubjectSource):
88    """A source for school subjects used in exam documentation.
89    """
90
91    def getTitle(self, value):
92        subjects_dict = getUtility(IKofaUtils).EXAM_SUBJECTS_DICT
93        return "%s" % subjects_dict[value]
94
95# Fields to be omitted in all display forms. course_admitted is
96# rendered separately.
97
98OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted',
99    'result_uploaded', 'suspended', 'special_application')
100
101# UG students are all undergraduate students.
102UG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + (
103    'jamb_subjects_list', 'programme_type')
104UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('phone',)
105UG_OMIT_MANAGE_FIELDS = (
106    'special_application',
107    'jamb_subjects_list',
108    'programme_type')
109UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + OMIT_DISPLAY_FIELDS + (
110    'student_id',
111    'notice',
112    'screening_score',
113    'screening_venue',
114    'screening_date',
115    'jamb_age',
116    'jamb_subjects',
117    'jamb_score',
118    'jamb_reg_number',
119    'aggregate')
120
121# CBT is a subgroup of UG with the same interface.
122CBT_OMIT_FIELDS = (
123    'hq_type', 'hq_matric_no',
124    'hq_degree', 'hq_school',
125    'hq_session', 'hq_disc',
126    'aggregate', 'jamb_subjects',
127    'programme_type')
128CBT_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + CBT_OMIT_FIELDS
129CBT_OMIT_MANAGE_FIELDS = CBT_OMIT_FIELDS + ('special_application',)
130CBT_OMIT_EDIT_FIELDS = OMIT_DISPLAY_FIELDS + CBT_OMIT_FIELDS + (
131    'special_application',
132    'student_id',
133    'notice',
134    'screening_score',
135    'screening_venue',
136    'screening_date',
137    #'jamb_age',
138    #'jamb_subjects',
139    #'jamb_score',
140    #'jamb_reg_number',
141    )
142CBT_OMIT_PDF_FIELDS = CBT_OMIT_DISPLAY_FIELDS + ('phone',)
143
144# AFFIL is a subgroup of UG with the same interface.
145AFFIL_OMIT_FIELDS = (
146    'hq_type', 'hq_matric_no',
147    'hq_degree', 'hq_school',
148    'hq_session', 'hq_disc',
149    'jamb_subjects',)
150AFFIL_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + AFFIL_OMIT_FIELDS
151AFFIL_OMIT_MANAGE_FIELDS = AFFIL_OMIT_FIELDS + ('special_application',)
152AFFIL_OMIT_EDIT_FIELDS = OMIT_DISPLAY_FIELDS + AFFIL_OMIT_FIELDS + (
153    'special_application',
154    'student_id',
155    'notice',
156    'screening_score',
157    'screening_venue',
158    'screening_date',
159    'aggregate',
160    )
161AFFIL_OMIT_PDF_FIELDS = AFFIL_OMIT_DISPLAY_FIELDS + ('phone',)
162
163# PUTME is a subgroup of UG with the same interface.
164PUTME_OMIT_FIELDS = (
165    'hq_type', 'hq_matric_no',
166    'hq_degree', 'hq_school',
167    'hq_session', 'hq_disc',
168    'jamb_subjects_list', 'programme_type')
169PUTME_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUTME_OMIT_FIELDS
170PUTME_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUTME_OMIT_FIELDS
171PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + PUTME_OMIT_FIELDS + (
172    'firstname', 'middlename', 'lastname', 'sex',
173    'course1', 'lga')
174PUTME_OMIT_PDF_FIELDS = PUTME_OMIT_DISPLAY_FIELDS + ('phone',)
175PUTME_OMIT_RESULT_SLIP_FIELDS = PUTME_OMIT_DISPLAY_FIELDS + (
176    'phone',
177    'date_of_birth', 'sex',
178    'nationality', 'lga', #'perm_address',
179    'course2', 'screening_venue',
180    'screening_date')
181
182# PUDE is a subgroup of UG with the same interface.
183PUDE_OMIT_FIELDS = (
184    'jamb_subjects',
185    'jamb_score',
186    'jamb_age',
187    'aggregate',
188    'jamb_subjects_list',
189    'programme_type')
190PUDE_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUDE_OMIT_FIELDS
191PUDE_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUDE_OMIT_FIELDS
192PUDE_OMIT_EDIT_FIELDS = set(UG_OMIT_EDIT_FIELDS + PUDE_OMIT_FIELDS + (
193    'firstname', 'middlename', 'lastname', 'sex',
194    'course1', 'lga'))
195PUDE_OMIT_PDF_FIELDS = PUDE_OMIT_DISPLAY_FIELDS + ('phone',)
196PUDE_OMIT_RESULT_SLIP_FIELDS = PUDE_OMIT_DISPLAY_FIELDS + (
197    'phone',
198    'date_of_birth', 'sex',
199    'nationality', 'lga', #'perm_address',
200    'course2', 'screening_venue',
201    'screening_date')
202
203# PG has its own interface
204PG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS
205PG_OMIT_PDF_FIELDS = PG_OMIT_DISPLAY_FIELDS + ('phone',)
206PG_OMIT_MANAGE_FIELDS = ('special_application',)
207PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + PG_OMIT_DISPLAY_FIELDS + (
208    'student_id', 'notice',
209    'screening_score', 'screening_venue',
210    'screening_date',)
211
212class INigeriaUGApplicant(IApplicantBaseData):
213    """An undergraduate applicant.
214
215    This interface defines the least common multiple of all fields
216    in ug application forms. In customized forms, fields can be excluded by
217    adding them to the UG_OMIT* tuples.
218    """
219
220    nationality = schema.Choice(
221        source = nats_vocab,
222        title = _(u'Nationality'),
223        required = False,
224        )
225    lga = schema.Choice(
226        source = LGASource(),
227        title = _(u'State/LGA (Nigerians only)'),
228        required = False,
229        )
230    #perm_address = schema.Text(
231    #    title = _(u'Permanent Address'),
232    #    required = False,
233    #    )
234    course1 = schema.Choice(
235        title = _(u'1st Choice Course of Study'),
236        source = AppCatCertificateSource(),
237        required = True,
238        )
239    course2 = schema.Choice(
240        title = _(u'2nd Choice Course of Study'),
241        source = AppCatCertificateSource(),
242        required = False,
243        )
244
245    programme_type = schema.Choice(
246        title = _(u'Programme Type'),
247        vocabulary = programme_types_vocab,
248        required = False,
249        )
250
251    hq_type = schema.Choice(
252        title = _(u'Qualification Obtained'),
253        required = False,
254        readonly = False,
255        vocabulary = high_qual,
256        )
257    hq_matric_no = schema.TextLine(
258        title = _(u'Former Matric Number'),
259        required = False,
260        readonly = False,
261        )
262    hq_degree = schema.Choice(
263        title = _(u'Class of Degree'),
264        required = False,
265        readonly = False,
266        vocabulary = high_grade,
267        )
268    hq_school = schema.TextLine(
269        title = _(u'Institution Attended'),
270        required = False,
271        readonly = False,
272        )
273    hq_session = schema.TextLine(
274        title = _(u'Years Attended'),
275        required = False,
276        readonly = False,
277        )
278    hq_disc = schema.TextLine(
279        title = _(u'Discipline'),
280        required = False,
281        readonly = False,
282        )
283    jamb_subjects = schema.Text(
284        title = _(u'Subjects and Scores'),
285        required = False,
286        )
287    jamb_subjects_list = schema.List(
288        title = _(u'JAMB Subjects'),
289        required = False,
290        default = [],
291        value_type = schema.Choice(
292            vocabulary = jambsubjects
293            #source = JAMBSubjectSource(),
294            ),
295        )
296    jamb_score = schema.Int(
297        title = _(u'Total JAMB Score'),
298        required = False,
299        )
300    #jamb_age = schema.Int(
301    #    title = _(u'Age (provided by JAMB)'),
302    #    required = False,
303    #    )
304    jamb_reg_number = schema.TextLine(
305        title = _(u'JAMB Registration Number'),
306        required = False,
307        )
308    notice = schema.Text(
309        title = _(u'Notice'),
310        required = False,
311        )
312    screening_venue = schema.TextLine(
313        title = _(u'Screening Venue'),
314        required = False,
315        )
316    screening_date = schema.TextLine(
317        title = _(u'Screening Date'),
318        required = False,
319        )
320    screening_score = schema.Int(
321        title = _(u'Screening Score (%)'),
322        required = False,
323        )
324    aggregate = schema.Int(
325        title = _(u'Aggregate Score (%)'),
326        description = _(u'(average of relative JAMB and PUTME scores)'),
327        required = False,
328        )
329    result_uploaded = schema.Bool(
330        title = _(u'Result uploaded'),
331        default = False,
332        required = False,
333        )
334    student_id = schema.TextLine(
335        title = _(u'Student Id'),
336        required = False,
337        readonly = False,
338        )
339    course_admitted = schema.Choice(
340        title = _(u'Admitted Course of Study'),
341        source = CertificateSource(),
342        required = False,
343        )
344    locked = schema.Bool(
345        title = _(u'Form locked'),
346        default = False,
347        required = False,
348        )
349
350INigeriaUGApplicant[
351    'locked'].order =  IApplicantBaseData['suspended'].order
352INigeriaUGApplicant[
353    'result_uploaded'].order =  INigeriaUGApplicant['suspended'].order
354
355class INigeriaPGApplicant(IApplicantBaseData):
356    """A postgraduate applicant.
357
358    This interface defines the least common multiple of all fields
359    in pg application forms. In customized forms, fields can be excluded by
360    adding them to the PG_OMIT* tuples.
361    """
362
363    nationality = schema.Choice(
364        source = nats_vocab,
365        title = _(u'Nationality'),
366        required = True,
367        )
368    lga = schema.Choice(
369        source = LGASource(),
370        title = _(u'State/LGA (Nigerians only)'),
371        required = False,
372        )
373    #perm_address = schema.Text(
374    #    title = _(u'Permanent Address'),
375    #    required = False,
376    #    )
377    course1 = schema.Choice(
378        title = _(u'1st Choice Course of Study'),
379        source = AppCatCertificateSource(),
380        required = True,
381        )
382    course2 = schema.Choice(
383        title = _(u'2nd Choice Course of Study'),
384        source = AppCatCertificateSource(),
385        required = False,
386        )
387    hq_type = schema.Choice(
388        title = _(u'Qualification Obtained'),
389        required = False,
390        readonly = False,
391        vocabulary = high_qual,
392        )
393    hq_fname = schema.TextLine(
394        title = _(u'Full Name'),
395        required = False,
396        readonly = False,
397        )
398    hq_matric_no = schema.TextLine(
399        title = _(u'Former Matric Number'),
400        required = False,
401        readonly = False,
402        )
403    hq_degree = schema.Choice(
404        title = _(u'Class of Degree'),
405        required = False,
406        readonly = False,
407        vocabulary = high_grade,
408        )
409    hq_school = schema.TextLine(
410        title = _(u'Institution Attended'),
411        required = False,
412        readonly = False,
413        )
414    hq_session = schema.TextLine(
415        title = _(u'Years Attended'),
416        required = False,
417        readonly = False,
418        )
419    hq_disc = schema.TextLine(
420        title = _(u'Discipline'),
421        required = False,
422        readonly = False,
423        )
424    fst_sit_fname = schema.TextLine(
425        title = _(u'Full Name'),
426        required = False,
427        readonly = False,
428        )
429    fst_sit_no = schema.TextLine(
430        title = _(u'Exam Number'),
431        required = False,
432        readonly = False,
433        )
434    fst_sit_date = FormattedDate(
435        title = _(u'Exam Date'),
436        required = False,
437        readonly = False,
438        show_year = True,
439        )
440    fst_sit_type = schema.Choice(
441        title = _(u'Exam Type'),
442        required = False,
443        readonly = False,
444        vocabulary = exam_types,
445        )
446    fst_sit_results = schema.List(
447        title = _(u'Exam Results'),
448        value_type = ResultEntryField(),
449        required = False,
450        readonly = False,
451        default = [],
452        )
453    scd_sit_fname = schema.TextLine(
454        title = _(u'Full Name'),
455        required = False,
456        readonly = False,
457        )
458    scd_sit_no = schema.TextLine(
459        title = _(u'Exam Number'),
460        required = False,
461        readonly = False,
462        )
463    scd_sit_date = FormattedDate(
464        title = _(u'Exam Date'),
465        required = False,
466        readonly = False,
467        show_year = True,
468        )
469    scd_sit_type = schema.Choice(
470        title = _(u'Exam Type'),
471        required = False,
472        readonly = False,
473        vocabulary = exam_types,
474        )
475    scd_sit_results = schema.List(
476        title = _(u'Exam Results'),
477        value_type = ResultEntryField(),
478        required = False,
479        readonly = False,
480        default = [],
481        )
482    # Replaced by first and second sitting
483    #pp_school = schema.Choice(
484    #    title = _(u'Qualification Obtained'),
485    #    required = False,
486    #    readonly = False,
487    #    vocabulary = exam_types,
488    #    )
489    presently_inst = schema.TextLine(
490        title = _(u'If yes, name of institution'),
491        required = False,
492        readonly = False,
493        )
494    nysc_year = schema.Int(
495        title = _(u'Nysc Year'),
496        required = False,
497        readonly = False,
498        )
499    nysc_lga = schema.Choice(
500        source = LGASource(),
501        title = _(u'Nysc Location'),
502        required = False,
503        )
504    employer = schema.TextLine(
505        title = _(u'Employer'),
506        required = False,
507        readonly = False,
508        )
509    emp_position = schema.TextLine(
510        title = _(u'Employer Position'),
511        required = False,
512        readonly = False,
513        )
514    emp_start = FormattedDate(
515        title = _(u'Start Date'),
516        required = False,
517        readonly = False,
518        show_year = True,
519        )
520    emp_end = FormattedDate(
521        title = _(u'End Date'),
522        required = False,
523        readonly = False,
524        show_year = True,
525        )
526    emp_reason = schema.TextLine(
527        title = _(u'Reason for Leaving'),
528        required = False,
529        readonly = False,
530        )
531    employer2 = schema.TextLine(
532        title = _(u'2nd Employer'),
533        required = False,
534        readonly = False,
535        )
536    emp2_position = schema.TextLine(
537        title = _(u'2nd Employer Position'),
538        required = False,
539        readonly = False,
540        )
541    emp2_start = FormattedDate(
542        title = _(u'Start Date'),
543        required = False,
544        readonly = False,
545        show_year = True,
546        )
547    emp2_end = FormattedDate(
548        title = _(u'End Date'),
549        required = False,
550        readonly = False,
551        show_year = True,
552        )
553    emp2_reason = schema.TextLine(
554        title = _(u'Reason for Leaving'),
555        required = False,
556        readonly = False,
557        )
558    notice = schema.Text(
559        title = _(u'Notice'),
560        required = False,
561        readonly = False,
562        )
563    screening_venue = schema.TextLine(
564        title = _(u'Screening Venue'),
565        required = False,
566        )
567    screening_date = schema.TextLine(
568        title = _(u'Screening Date'),
569        required = False,
570        )
571    screening_score = schema.Int(
572        title = _(u'Screening Score (%)'),
573        required = False,
574        )
575    student_id = schema.TextLine(
576        title = _(u'Student Id'),
577        required = False,
578        readonly = False,
579        )
580    course_admitted = schema.Choice(
581        title = _(u'Admitted Course of Study'),
582        source = CertificateSource(),
583        required = False,
584        readonly = False,
585        )
586    locked = schema.Bool(
587        title = _(u'Form locked'),
588        default = False,
589        required = False,
590        )
591
592INigeriaPGApplicant[
593    'locked'].order =  IApplicantBaseData['suspended'].order
594
595# PRE is used by Uniben
596#  med: "it is as named... PRE - DEGREE... much like a 1 year diploma programme"
597PRE_OMIT_FIELDS = tuple([
598    i for i in getFields(INigeriaPGApplicant).keys()
599        if i[:3] in ('hq_', 'emp', 'nys')])
600PRE_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PRE_OMIT_FIELDS
601PRE_OMIT_MANAGE_FIELDS = PG_OMIT_MANAGE_FIELDS + PRE_OMIT_FIELDS
602PRE_OMIT_EDIT_FIELDS = set(PG_OMIT_EDIT_FIELDS + PRE_OMIT_FIELDS)
603PRE_OMIT_PDF_FIELDS = PRE_OMIT_DISPLAY_FIELDS
604PRE_OMIT_RESULT_SLIP_FIELDS = PRE_OMIT_DISPLAY_FIELDS
605
606class INigeriaApplicant(INigeriaUGApplicant, INigeriaPGApplicant):
607    """An interface for both types of applicants.
608
609    Attention: The INigeriaPGApplicant field seetings will be overwritten
610    by INigeriaPGApplicant field settings. If a field is defined
611    in both interfaces zope.schema validates only against the
612    constraints in INigeriaUGApplicant. This does not affect the forms
613    since they are build on either INigeriaUGApplicant or INigeriaPGApplicant.
614    """
615
616    def writeLogMessage(view, comment):
617        """Adds an INFO message to the log file
618        """
619
620    def createStudent():
621        """Create a student object from applicant data
622        and copy applicant object.
623        """
624
625class INigeriaUGApplicantEdit(INigeriaUGApplicant):
626    """An undergraduate applicant interface for edit forms.
627
628    Here we can repeat the fields from base data and set the
629    `required` and `readonly` attributes to True to further restrict
630    the data access. Or we can allow only certain certificates to be
631    selected by choosing the appropriate source.
632
633    We cannot omit fields here. This has to be done in the
634    respective form page.
635    """
636
637    email = schema.ASCIILine(
638        title = _(u'Email Address'),
639        required = True,
640        constraint=validate_email,
641        )
642    date_of_birth = FormattedDate(
643        title = _(u'Date of Birth'),
644        required = True,
645        show_year = True,
646        )
647    jamb_subjects_list = schema.List(
648        title = _(u'JAMB Subjects'),
649        description = _(u'Select four subjects.'),
650        required = True,
651        constraint = four_items,
652        value_type = schema.Choice(
653            vocabulary = jambsubjects
654            #source = JAMBSubjectSource(),
655            ),
656        )
657
658INigeriaUGApplicantEdit[
659    'date_of_birth'].order = INigeriaUGApplicant['date_of_birth'].order
660INigeriaUGApplicantEdit[
661    'email'].order = INigeriaUGApplicant['email'].order
662INigeriaUGApplicantEdit[
663    'jamb_subjects_list'].order = INigeriaUGApplicant['jamb_subjects_list'].order
664
665class INigeriaPGApplicantEdit(INigeriaPGApplicant):
666    """A postgraduate applicant interface for editing.
667
668    Here we can repeat the fields from base data and set the
669    `required` and `readonly` attributes to True to further restrict
670    the data access. Or we can allow only certain certificates to be
671    selected by choosing the appropriate source.
672
673    We cannot omit fields here. This has to be done in the
674    respective form page.
675    """
676
677    email = schema.ASCIILine(
678        title = _(u'Email Address'),
679        required = True,
680        constraint=validate_email,
681        )
682    date_of_birth = FormattedDate(
683        title = _(u'Date of Birth'),
684        required = True,
685        show_year = True,
686        )
687
688INigeriaPGApplicantEdit[
689    'date_of_birth'].order =  INigeriaPGApplicant['date_of_birth'].order
690INigeriaPGApplicantEdit[
691    'email'].order =  INigeriaPGApplicant['email'].order
692
693class INigeriaApplicantOnlinePayment(INigeriaOnlinePayment):
694    """An applicant payment via payment gateways.
695    """
696
697class IPUTMEApplicantEdit(INigeriaUGApplicant):
698    """An undergraduate applicant interface for editing.
699
700    Here we can repeat the fields from base data and set the
701    `required` and `readonly` attributes to True to further restrict
702    the data access. Or we can allow only certain certificates to be
703    selected by choosing the appropriate source.
704
705    We cannot omit fields here. This has to be done in the
706    respective form page.
707    """
708    email = schema.ASCIILine(
709        title = _(u'Email Address'),
710        required = True,
711        constraint=validate_email,
712        )
713    date_of_birth = FormattedDate(
714        title = _(u'Date of Birth'),
715        required = True,
716        show_year = True,
717        )
718    nationality = schema.Choice(
719        source = nats_vocab,
720        title = _(u'Nationality'),
721        required = True,
722        )
723
724IPUTMEApplicantEdit[
725    'date_of_birth'].order =  INigeriaUGApplicant['date_of_birth'].order
726IPUTMEApplicantEdit[
727    'email'].order =  INigeriaUGApplicant['email'].order
728IPUTMEApplicantEdit[
729    'nationality'].order =  INigeriaUGApplicant['nationality'].order
730
731class INigeriaApplicantUpdateByRegNo(INigeriaApplicant):
732    """Representation of an applicant.
733
734    Skip regular reg_number validation if reg_number is used for finding
735    the applicant object.
736    """
737    reg_number = schema.TextLine(
738        title = u'Registration Number',
739        required = False,
740        )
Note: See TracBrowser for help on using the repository browser.