Changeset 17683 for main


Ignore:
Timestamp:
29 Jan 2024, 11:38:51 (11 months ago)
Author:
Henrik Bettermann
Message:

Modify application form. Upon application, the candidate must be seventeen years old (17).

Location:
main/kofacustom.edocons/trunk/src/kofacustom/edocons/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/applicants/browser.py

    r17465 r17683  
    7373# UG students are all undergraduate students.
    7474UG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + (
    75     'jamb_subjects_list', 'programme_type')
     75    'jamb_subjects', 'programme_type')
    7676UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('phone',)
    7777UG_OMIT_MANAGE_FIELDS = (
    7878    'special_application',
    79     'jamb_subjects_list',
     79    'jamb_subjects',
    8080    'programme_type',
    8181    #'course1', 'course2', # these 2 have been added and later removed again
     
    9191    'cbt_date',
    9292    'jamb_age',
    93     #'jamb_subjects',
    94     #'jamb_score',
    95     #'jamb_reg_number',
    9693    'aggregate')
    9794
     
    131128            form_fields['notice'].custom_widget = BytesDisplayWidget
    132129        if self.context.__parent__.application_category == 'rnnurse':
    133             form_fields = form_fields.omit('jamb_reg_number', 'jamb_subjects', 'jamb_score', 'course2')
     130            form_fields = form_fields.omit('jamb_reg_number', 'jamb_subjects_list', 'jamb_score', 'course2')
    134131        #form_fields['perm_address'].custom_widget = BytesDisplayWidget
    135132        if not getattr(self.context, 'student_id'):
     
    168165                form_fields = form_fields.omit(field)
    169166        if self.context.__parent__.application_category == 'rnnurse':
    170             form_fields = form_fields.omit('jamb_reg_number', 'jamb_subjects', 'jamb_score', 'course2')
     167            form_fields = form_fields.omit('jamb_reg_number', 'jamb_subjects_list', 'jamb_score', 'course2')
    171168        if self.context.__parent__.application_category == 'ndnurse':
    172169            form_fields = form_fields.omit('course2')
     
    212209                form_fields = form_fields.omit(field)
    213210        if self.context.__parent__.application_category == 'rnnurse':
    214             form_fields = form_fields.omit('jamb_reg_number', 'jamb_subjects', 'jamb_score', 'course2')
     211            form_fields = form_fields.omit('jamb_reg_number', 'jamb_subjects_list', 'jamb_score', 'course2')
    215212        if self.context.__parent__.application_category == 'ndnurse':
    216213            form_fields = form_fields.omit('course2')
     
    247244                form_fields = form_fields.omit(field)
    248245        if self.context.__parent__.application_category == 'rnnurse':
    249             form_fields = form_fields.omit('jamb_reg_number', 'jamb_subjects', 'jamb_score', 'course2')
     246            form_fields = form_fields.omit('jamb_reg_number', 'jamb_subjects_list', 'jamb_score', 'course2')
    250247        if self.context.__parent__.application_category == 'ndnurse':
    251248            form_fields = form_fields.omit('course2')
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/applicants/interfaces.py

    r17681 r17683  
    4242from kofacustom.nigeria.applicants.interfaces import (
    4343    LGASource, high_qual, high_grade, exam_types,
    44     jambsubjects,
     44    #jambsubjects,
    4545    INigeriaUGApplicant, INigeriaPGApplicant,
    4646    INigeriaApplicantOnlinePayment,
     
    5959    curr_year = datetime.now().year
    6060    return range(curr_year - 50, curr_year)
     61
     62jambsubjects = SimpleKofaVocabulary(
     63    (_('English'),'english_language'),
     64    #(_('Agricultural Science'),'agricultural_science'),
     65    #(_('Arabic'),'arabic'),
     66    (_('Biology'),'biology'),
     67    #(_('Book Keeping'),'book_keeping'),
     68    (_('Chemistry'),'chemistry'),
     69    #(_('Christian Religious Studies'),'christian_religious_studies'),
     70    #(_('Commerce'),'commerce'),
     71    #(_('Economics'),'economics'),
     72    #(_('Financial Accounting'),'financial_accounting'),
     73    #(_('Fine Art'),'fine_art'),
     74    #(_('Food and Nutrition'),'food_and_nutrition'),
     75    #(_('French'),'french'),
     76    #(_('Geography'),'geography'),
     77    #(_('German'),'german'),
     78    #(_('Government'),'government'),
     79    #(_('Hausa'),'hausa'),
     80    #(_('Home Economics'),'home_economics'),
     81    #(_('History'),'history'),
     82    #(_('Igbo'),'igbo'),
     83    #(_('Literature in English'),'literature_in_english'),
     84    #(_('Literature in Nigerian Languages'),'literature_in_nigerian_languages'),
     85    #(_('Mathematics'),'mathematics'),
     86    #(_('Music'),'music'),
     87    (_('Physics'),'physics'),
     88    #(_('Yoruba'),'yoruba'),
     89    )
    6190
    6291programme_types_vocab = SimpleKofaVocabulary(
     
    386415        )
    387416
     417    @invariant
     418    def date_of_birth(applicant):
     419        today = datetime.today()
     420        age = today.year - applicant.date_of_birth.year - ((today.month, today.day) < (applicant.date_of_birth.month, applicant.date_of_birth.day))
     421        if age < 17:
     422            raise Invalid(_("Upon application, the candidate must be seventeen years old (17)."))
     423
    388424class ICustomPGApplicant(INigeriaPGApplicant):
    389425    """A postgraduate applicant.
Note: See TracChangeset for help on using the changeset viewer.