Ignore:
Timestamp:
8 Nov 2018, 12:45:03 (6 years ago)
Author:
Henrik Bettermann
Message:

Implement special application (for supplementary payments).

Location:
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/applicants
Files:
4 edited

Legend:

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

    r15131 r15218  
    2626from kofacustom.nigeria.applicants.applicant import NigeriaApplicant
    2727from kofacustom.edopoly.applicants.interfaces import(
    28     ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit, IPUTMEApplicantEdit)
     28    ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit,
     29    IPUTMEApplicantEdit, ICustomSpecialApplicant)
    2930
    3031class CustomApplicant(NigeriaApplicant):
    3132
    3233    grok.implements(ICustomApplicant, ICustomUGApplicantEdit,
    33         ICustomPGApplicantEdit, IPUTMEApplicantEdit)
     34        ICustomPGApplicantEdit, IPUTMEApplicantEdit, ICustomSpecialApplicant)
    3435    grok.provides(ICustomApplicant)
    3536
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/applicants/browser.py

    r15171 r15218  
    4747    ICustomUGApplicantEdit, ICustomUGApplicant,
    4848    ICustomPGApplicantEdit, ICustomPGApplicant,
    49     ICustomApplicant,)
     49    ICustomApplicant, ICustomSpecialApplicant,)
    5050
    5151from kofacustom.edopoly.interfaces import MessageFactory as _
     
    8585    def form_fields(self):
    8686        target = getattr(self.context.__parent__, 'prefix', None)
     87        if self.context.special:
     88            return grok.AutoFields(ICustomSpecialApplicant)
    8789        form_fields = grok.AutoFields(ICustomUGApplicant)
    8890        for field in UG_OMIT_DISPLAY_FIELDS:
     
    217219    @property
    218220    def form_fields(self):
     221        if self.context.special:
     222            form_fields = grok.AutoFields(ICustomSpecialApplicant)
     223            form_fields['applicant_id'].for_display = True
     224            return form_fields
    219225        target = getattr(self.context.__parent__, 'prefix', None)
    220226        form_fields = grok.AutoFields(ICustomUGApplicant)
     
    231237    @property
    232238    def form_fields(self):
     239        if self.context.special:
     240            form_fields = grok.AutoFields(ICustomSpecialApplicant).omit(
     241                'locked', 'suspended')
     242            form_fields['applicant_id'].for_display = True
     243            return form_fields
    233244        target = getattr(self.context.__parent__, 'prefix', None)
    234245        form_fields = grok.AutoFields(ICustomUGApplicantEdit)
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/applicants/interfaces.py

    r15169 r15218  
    2828from waeup.kofa.schema import FormattedDate, TextLineChoice
    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,
     
    225226    """
    226227
     228class ICustomSpecialApplicant(ISpecialApplicant):
     229    """
     230    """
    227231
    228232class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant):
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/applicants/utils.py

    r15110 r15218  
    4242        'pre': ['Pre-Degree Studies', 'PRE'],
    4343        'ct': ['Certificate Programmes', 'CT'],
     44        'special': ['Supplementary Payment', 'SP'],
    4445        }
    4546
Note: See TracChangeset for help on using the changeset viewer.