Ignore:
Timestamp:
26 Jul 2012, 04:35:28 (12 years ago)
Author:
Henrik Bettermann
Message:

Change order of pages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/browser.py

    r9049 r9050  
    6363        return _('Download application slip')
    6464
     65class NigeriaApplicantDisplayFormPage(ApplicantDisplayFormPage):
     66    """A display view for applicant data.
     67    """
     68
     69    @property
     70    def form_fields(self):
     71        target = getattr(self.context.__parent__, 'prefix', None)
     72        if target is not None and target.startswith('pg'):
     73            form_fields = grok.AutoFields(INigeriaPGApplicant)
     74            for field in PG_OMIT_DISPLAY_FIELDS:
     75                form_fields = form_fields.omit(field)
     76        elif target is not None and target.startswith('putme'):
     77            form_fields = grok.AutoFields(INigeriaUGApplicant)
     78            for field in PUTME_OMIT_DISPLAY_FIELDS:
     79                form_fields = form_fields.omit(field)
     80        else:
     81            form_fields = grok.AutoFields(INigeriaUGApplicant)
     82            for field in UG_OMIT_DISPLAY_FIELDS:
     83                form_fields = form_fields.omit(field)
     84        return form_fields
    6585
    6686class NigeriaPDFApplicationSlip(PDFApplicationSlip):
     
    99119        if not getattr(self.context, 'student_id'):
    100120            form_fields = form_fields.omit('student_id')
    101         return form_fields
    102 
    103 class NigeriaApplicantDisplayFormPage(ApplicantDisplayFormPage):
    104     """A display view for applicant data.
    105     """
    106 
    107     @property
    108     def form_fields(self):
    109         target = getattr(self.context.__parent__, 'prefix', None)
    110         if target is not None and target.startswith('pg'):
    111             form_fields = grok.AutoFields(INigeriaPGApplicant)
    112             for field in PG_OMIT_DISPLAY_FIELDS:
    113                 form_fields = form_fields.omit(field)
    114         elif target is not None and target.startswith('putme'):
    115             form_fields = grok.AutoFields(INigeriaUGApplicant)
    116             for field in PUTME_OMIT_DISPLAY_FIELDS:
    117                 form_fields = form_fields.omit(field)
    118         else:
    119             form_fields = grok.AutoFields(INigeriaUGApplicant)
    120             for field in UG_OMIT_DISPLAY_FIELDS:
    121                 form_fields = form_fields.omit(field)
    122121        return form_fields
    123122
Note: See TracChangeset for help on using the changeset viewer.