Changeset 17013


Ignore:
Timestamp:
8 Jul 2022, 11:14:06 (2 years ago)
Author:
Henrik Bettermann
Message:

Add ICustomApplicantEdit interface.

Location:
main/kofacustom.lpng/trunk/src/kofacustom/lpng
Files:
4 edited

Legend:

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

    r16997 r17013  
    2323from kofacustom.nigeria.applicants.applicant import NigeriaApplicant
    2424from kofacustom.lpng.applicants.interfaces import(
    25     ICustomApplicant,)
     25    ICustomApplicant, ICustomApplicantEdit)
    2626
    2727class CustomApplicant(NigeriaApplicant):
    2828
    29     grok.implements(ICustomApplicant)
     29    grok.implements(ICustomApplicant, ICustomApplicantEdit)
    3030    grok.provides(ICustomApplicant)
    3131
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser.py

    r16997 r17013  
    3030    ICustomApplicant,
    3131    ICustomApplicantOnlinePayment,
     32    ICustomApplicantEdit,
    3233    )
    3334
     
    7879    @property
    7980    def form_fields(self):
    80         form_fields = grok.AutoFields(ICustomApplicant)
     81        form_fields = grok.AutoFields(ICustomApplicantEdit)
    8182        form_fields = form_fields.omit('notice')
    8283        if not getattr(self.context, 'student_id'):
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/interfaces.py

    r17011 r17013  
    6969        )
    7070       
    71     vin = schema.TextLine(
    72         title = _(u'Voter Identification No (VIN)'),
    73         required = True,
    74         )
    75 
    7671    reg_number = TextLineChoice(
    7772        title = _(u'Registration Number'),
     
    7974        required = False,
    8075        source = contextual_reg_num_source,
     76        )
     77
     78    vin = schema.TextLine(
     79        title = _(u'Voter Identification No (VIN)'),
     80        required = True,
    8181        )
    8282
     
    195195        """
    196196
     197class ICustomApplicantEdit(ICustomApplicant):
     198    """This is an applicant interface for editing.
     199
     200    Here we can repeat the fields from base data and set the
     201    `required` and `readonly` attributes to True to further restrict
     202    the data access. Or we can allow only certain certificates to be
     203    selected by choosing the appropriate source.
     204
     205    We cannot omit fields here. This has to be done in the
     206    respective form page.
     207    """
     208
     209    reg_number = TextLineChoice(
     210        title = _(u'Registration Number'),
     211        readonly = True,
     212        required = False,
     213        source = contextual_reg_num_source,
     214        )
     215
     216ICustomApplicantEdit['reg_number'].order = ICustomApplicant['reg_number'].order
     217
    197218class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
    198219    """An applicant payment via payment gateways.
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/interswitch/tests.py

    r17011 r17013  
    221221        self.browser.getControl(name="transition").value = ['start']
    222222        self.browser.getControl("Save").click()
    223         self.browser.getControl("Add online").click()
     223        self.browser.getControl("Pay membership").click()
    224224        self.assertMatches('...ticket created...',
    225225                           self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.