Ignore:
Timestamp:
6 Oct 2017, 14:05:18 (7 years ago)
Author:
Henrik Bettermann
Message:

Customize ISpecialApplicant.

Location:
main/kofacustom.dspg/trunk/src/kofacustom/dspg/applicants
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/applicants/applicant.py

    r14721 r14865  
    2323from kofacustom.nigeria.applicants.applicant import NigeriaApplicant
    2424from kofacustom.dspg.applicants.interfaces import(
    25     ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit, IPUTMEApplicantEdit)
     25    ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit,
     26    IPUTMEApplicantEdit, ICustomSpecialApplicant)
    2627
    2728class CustomApplicant(NigeriaApplicant):
    2829
    2930    grok.implements(ICustomApplicant, ICustomUGApplicantEdit,
    30         ICustomPGApplicantEdit, IPUTMEApplicantEdit)
     31        ICustomPGApplicantEdit, IPUTMEApplicantEdit, ICustomSpecialApplicant)
    3132    grok.provides(ICustomApplicant)
    3233
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/applicants/browser.py

    r14807 r14865  
    2626from waeup.kofa.interfaces import IExtFileStore, IKofaUtils
    2727from waeup.kofa.applicants.interfaces import (
    28     IApplicant, IApplicantEdit, ISpecialApplicant)
     28    IApplicant, IApplicantEdit)
    2929from waeup.kofa.applicants.browser import (ApplicantDisplayFormPage,
    3030    ApplicantManageFormPage, ApplicantEditFormPage,
     
    4242from kofacustom.dspg.applicants.interfaces import (
    4343    ICustomUGApplicant, ICustomUGApplicantEdit,
     44    ICustomSpecialApplicant,
    4445    ND_OMIT_DISPLAY_FIELDS,
    4546    ND_OMIT_PDF_FIELDS,
     
    8081    def form_fields(self):
    8182        if self.context.special:
    82             return grok.AutoFields(ISpecialApplicant)
     83            return grok.AutoFields(ICustomSpecialApplicant)
    8384        form_fields = grok.AutoFields(ICustomUGApplicant)
    8485        if self.context.is_nd:
     
    162163    def form_fields(self):
    163164        if self.context.special:
    164             form_fields = grok.AutoFields(ISpecialApplicant)
     165            form_fields = grok.AutoFields(ICustomSpecialApplicant)
    165166            form_fields['applicant_id'].for_display = True
    166167            return form_fields
     
    176177        return form_fields
    177178
     179    def setUpWidgets(self, ignore_request=False):
     180        super(CustomApplicantManageFormPage,self).setUpWidgets(ignore_request)
     181        if self.context.special:
     182            self.widgets['carryover_courses'].height = 3
     183        return
     184
    178185class CustomApplicantEditFormPage(ApplicantEditFormPage):
    179186    """An applicant-centered edit view for applicant data.
     
    186193    def form_fields(self):
    187194        if self.context.special:
    188             form_fields = grok.AutoFields(ISpecialApplicant).omit(
     195            form_fields = grok.AutoFields(ICustomSpecialApplicant).omit(
    189196                'locked', 'suspended')
    190197            form_fields['applicant_id'].for_display = True
     
    203210        form_fields['reg_number'].for_display = True
    204211        return form_fields
     212
     213    def setUpWidgets(self, ignore_request=False):
     214        super(CustomApplicantEditFormPage,self).setUpWidgets(ignore_request)
     215        if self.context.special:
     216            self.widgets['carryover_courses'].height = 3
     217        return
    205218
    206219    @property
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/applicants/interfaces.py

    r14831 r14865  
    2828from waeup.kofa.schema import FormattedDate, TextLineChoice, PhoneNumber
    2929from waeup.kofa.students.vocabularies import nats_vocab, GenderSource
    30 from waeup.kofa.applicants.interfaces import contextual_reg_num_source
     30from waeup.kofa.applicants.interfaces import (
     31    contextual_reg_num_source, ISpecialApplicant)
    3132from kofacustom.nigeria.applicants.interfaces import (
    3233    LGASource, high_qual, high_grade, exam_types,
     
    281282    """
    282283
    283 class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant):
     284class ICustomSpecialApplicant(ISpecialApplicant):
     285
     286    carryover_courses = schema.Text(
     287        title = _(u'Carry-Over Courses'),
     288        required = False,
     289        description = _(
     290            u'Enter course titles if carry-over remedial payment.'),
     291        )
     292
     293class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant,
     294                       ICustomSpecialApplicant):
    284295    """An interface for both types of applicants.
    285296
Note: See TracChangeset for help on using the changeset viewer.