Changeset 16559


Ignore:
Timestamp:
29 Jul 2021, 08:08:22 (3 years ago)
Author:
Henrik Bettermann
Message:

Hide jamb fields for JUPEB application.

Customize broken ApplicantAddFormPage?.

File:
1 edited

Legend:

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

    r16546 r16559  
    3030    RefereeReportAddFormPage, ExportPDFReportSlipPage, ExportPDFReportSlipPage2,
    3131    RefereeReportDisplayFormPage,
    32     ApplicantsContainerManageFormPage)
     32    ApplicantsContainerManageFormPage,
     33    ApplicantAddFormPage)
    3334from waeup.kofa.applicants.interfaces import (
    3435    ISpecialApplicant, IApplicantsContainer, AppCatCertificateSource)
     
    8687    )
    8788
     89JUPEB_OMIT_FIELDS = (
     90    'jamb_age',
     91    'jamb_subjects',
     92    'jamb_score',
     93    'jamb_reg_number',
     94    'jamb_subjects_list',
     95    'jamb_fname',
     96    )
     97
    8898# PG has its own interface
    8999PG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + (
     
    184194            form_fields = grok.AutoFields(ICustomUGApplicant)
    185195            for field in UG_OMIT_DISPLAY_FIELDS:
     196                form_fields = form_fields.omit(field)
     197        if self.target is not None and self.target == 'pre':
     198            for field in JUPEB_OMIT_FIELDS:
    186199                form_fields = form_fields.omit(field)
    187200        #form_fields['perm_address'].custom_widget = BytesDisplayWidget
     
    295308            for field in UG_OMIT_MANAGE_FIELDS:
    296309                form_fields = form_fields.omit(field)
     310        if self.target is not None and self.target == 'pre':
     311            for field in JUPEB_OMIT_FIELDS:
     312                form_fields = form_fields.omit(field)
    297313        form_fields['student_id'].for_display = True
    298314        form_fields['applicant_id'].for_display = True
     
    348364            for field in UG_OMIT_EDIT_FIELDS:
    349365                form_fields = form_fields.omit(field)
     366        if self.target is not None and self.target == 'pre':
     367            for field in JUPEB_OMIT_FIELDS:
     368                form_fields = form_fields.omit(field)
    350369        form_fields['applicant_id'].for_display = True
    351370        form_fields['reg_number'].for_display = True
     
    388407        return form_fields
    389408
     409class CustomApplicantAddFormPage(ApplicantAddFormPage):
     410    """Add-form to add an applicant.
     411    """
     412    form_fields = grok.AutoFields(ICustomApplicant).select(
     413        'firstname', 'middlename', 'lastname',
     414        'email', 'phone')
     415
    390416class RefereeReportAddFormPage(RefereeReportAddFormPage):
    391417    """Add-form to add an referee report. This form
Note: See TracChangeset for help on using the changeset viewer.