Changeset 18067 for main/waeup.fceokene


Ignore:
Timestamp:
24 Apr 2025, 01:07:30 (20 hours ago)
Author:
Henrik Bettermann
Message:

Add JAMB registration number and NIN.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/applicant.py

    r16918 r18067  
    3232    grok.provides(ICustomApplicant)
    3333
     34    applicant_student_mapping = NigeriaApplicant.applicant_student_mapping + [
     35        ('nin', 'nin'),
     36        ('jamb_reg_number', 'jamb_reg_number'),
     37        ]
     38
    3439# Set all attributes of CustomApplicant required in ICustomApplicant as field
    3540# properties. Doing this, we do not have to set initial attributes
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/interfaces.py

    r17744 r18067  
    426426        required = False,
    427427        )
     428    nin = schema.Int(
     429        title = _(u'National Identity Number (NIN)'),
     430        required = False,
     431        readonly = False,
     432        min=10000000000,
     433        max=99999999999,
     434        )
    428435    notice = schema.Text(
    429436        title = _(u'Notice'),
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/browser.py

    r17577 r18067  
    3636    NigeriaOnlinePaymentAddFormPage,
    3737    NigeriaExportPDFPaymentSlip,
     38    NigeriaStudentClearanceDisplayFormPage,
    3839    NigeriaStudentClearanceEditFormPage,
     40    NigeriaStudentClearanceManageFormPage,
    3941    NigeriaExportPDFClearanceSlip,
    4042    NigeriaExportPDFCourseRegistrationSlip,
     
    4547
    4648from waeup.fceokene.students.interfaces import (
    47     ICustomStudentOnlinePayment, ICustomUGStudentClearance,
     49    ICustomStudentOnlinePayment,
     50    ICustomUGStudentClearance,
     51    ICustomPGStudentClearance,
    4852    ICustomStudentStudyLevel)
    4953
     
    149153        return False
    150154
     155class CustomStudentClearanceDisplayFormPage(NigeriaStudentClearanceDisplayFormPage):
     156    """ Page to display student clearance data
     157    """
     158
     159    @property
     160    def form_fields(self):
     161        if self.context.is_postgrad:
     162            form_fields = grok.AutoFields(
     163                ICustomPGStudentClearance).omit('clearance_locked')
     164        else:
     165            form_fields = grok.AutoFields(
     166                ICustomUGStudentClearance).omit('clearance_locked')
     167        if not getattr(self.context, 'officer_comment'):
     168            form_fields = form_fields.omit('officer_comment')
     169        else:
     170            form_fields['officer_comment'].custom_widget = BytesDisplayWidget
     171        return form_fields
     172
     173
     174class CustomStudentClearanceManageFormPage(NigeriaStudentClearanceManageFormPage):
     175    """ Page to edit student clearance data
     176    """
     177
     178    @property
     179    def form_fields(self):
     180        if self.context.is_postgrad:
     181            form_fields = grok.AutoFields(
     182                ICustomPGStudentClearance).omit('clr_code')
     183        else:
     184            form_fields = grok.AutoFields(
     185                ICustomUGStudentClearance).omit('clr_code')
     186        return form_fields
     187
     188
    151189class CustomExportPDFClearanceSlip(NigeriaExportPDFClearanceSlip):
    152190    """Deliver a PDF slip of the context.
     
    184222    def dataNotComplete(self):
    185223        return False
     224
     225    @property
     226    def form_fields(self):
     227        if self.context.is_postgrad:
     228            form_fields = grok.AutoFields(ICustomPGStudentClearance).omit(
     229            'clearance_locked', 'nysc_location', 'clr_code', 'officer_comment',
     230            'physical_clearance_date')
     231        else:
     232            form_fields = grok.AutoFields(ICustomUGStudentClearance).omit(
     233            'clearance_locked', 'clr_code', 'officer_comment',
     234            'physical_clearance_date')
     235        return form_fields
    186236
    187237class CustomBedTicketAddPage(NigeriaBedTicketAddPage):
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/interfaces.py

    r14591 r18067  
    9090        readonly = False,
    9191        )
     92    jamb_reg_number = schema.TextLine(
     93        title = _(u'JAMB Registration Number'),
     94        required = False,
     95        readonly = False,
     96        )
     97
     98    nin = schema.Int(
     99        title = _(u'National Identity Number (NIN)'),
     100        required = False,
     101        readonly = False,
     102        min=10000000000,
     103        max=99999999999,
     104        )
    92105
    93106    fst_sit_fname = schema.TextLine(
Note: See TracChangeset for help on using the changeset viewer.