Changeset 10367 for main


Ignore:
Timestamp:
23 Jun 2013, 20:01:26 (11 years ago)
Author:
Henrik Bettermann
Message:

Select correct fields on forms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.imostate/src/waeup/imostate/applicants/browser.py

    r10359 r10367  
    3636    NigeriaApplicantManageFormPage,
    3737    NigeriaApplicantEditFormPage,
    38     NigeriaPDFApplicationSlip)
     38    NigeriaPDFApplicationSlip,
     39    UG_OMIT_DISPLAY_FIELDS,
     40    UG_OMIT_PDF_FIELDS,
     41    UG_OMIT_MANAGE_FIELDS,
     42    UG_OMIT_EDIT_FIELDS,
     43    )
    3944
    4045from waeup.imostate.applicants.workflow import STARTED
     
    9196    def form_fields(self):
    9297        form_fields = grok.AutoFields(ICustomUGApplicant)
     98        for field in UG_OMIT_DISPLAY_FIELDS:
     99            form_fields = form_fields.omit(field)
    93100        if form_fields.get('perm_address', None):
    94101            form_fields['perm_address'].custom_widget = BytesDisplayWidget
     
    116123    def form_fields(self):
    117124        form_fields = grok.AutoFields(ICustomUGApplicant)
     125        for field in UG_OMIT_PDF_FIELDS:
     126            form_fields = form_fields.omit(field)
    118127        if not getattr(self.context, 'student_id'):
    119128            form_fields = form_fields.omit('student_id')
     
    134143    def form_fields(self):
    135144        form_fields = grok.AutoFields(ICustomUGApplicant)
     145        for field in UG_OMIT_MANAGE_FIELDS:
     146            form_fields = form_fields.omit(field)
    136147        form_fields['student_id'].for_display = True
    137148        form_fields['applicant_id'].for_display = True
     
    179190    def form_fields(self):
    180191        form_fields = grok.AutoFields(ICustomUGApplicantEdit)
     192        for field in UG_OMIT_EDIT_FIELDS:
     193            form_fields = form_fields.omit(field)
    181194        form_fields['applicant_id'].for_display = True
    182195        form_fields['reg_number'].for_display = True
Note: See TracChangeset for help on using the changeset viewer.