Changeset 11250


Ignore:
Timestamp:
22 Feb 2014, 14:35:57 (11 years ago)
Author:
Henrik Bettermann
Message:

Remove higher qualification fields from fp application form. This request was part of trac ticket (82) which was not assigned to me.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/branches/henrik-diazo-themed/src/waeup/aaue/applicants/browser.py

    r10929 r11250  
    3535    UG_OMIT_PDF_FIELDS,
    3636    UG_OMIT_MANAGE_FIELDS,
    37     UG_OMIT_EDIT_FIELDS,
    38     PG_OMIT_DISPLAY_FIELDS,
    39     PG_OMIT_PDF_FIELDS,
    40     PG_OMIT_MANAGE_FIELDS,
    41     PG_OMIT_EDIT_FIELDS)
     37    UG_OMIT_EDIT_FIELDS)
    4238from waeup.aaue.applicants.interfaces import (
    4339    ICustomApplicant,
    4440    ICustomUGApplicant,
    45     ICustomPGApplicant,
    46     ICustomPGApplicantEdit,
    47     ICustomUGApplicantEdit)
     41    ICustomUGApplicantEdit
     42    )
    4843
    49 UG_OMIT_PDF_FIELDS = [
    50     element for element in UG_OMIT_PDF_FIELDS if not element == 'phone']
     44UG_OMIT_PDF_FIELDS = tuple([
     45    element for element in UG_OMIT_PDF_FIELDS if not element == 'phone'])
    5146UG_OMIT_PDF_FIELDS += ('reg_number','alr_fname', 'alr_no', 'alr_date',
    5247    'alr_results', 'notice')
     48
     49FP_OMIT_FIELDS = ('hq_type', 'hq_fname', 'hq_matric_no',
     50     'hq_degree', 'hq_school', 'hq_session', 'hq_disc')
     51FP_OMIT_DISPLAY_FIELDS = UG_OMIT_DISPLAY_FIELDS + FP_OMIT_FIELDS
     52FP_OMIT_PDF_FIELDS = UG_OMIT_PDF_FIELDS + FP_OMIT_FIELDS
     53FP_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + FP_OMIT_FIELDS
     54FP_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + FP_OMIT_FIELDS
    5355
    5456class CustomApplicantDisplayFormPage(NigeriaApplicantDisplayFormPage):
     
    5860    @property
    5961    def form_fields(self):
    60         if self.target is not None and self.target.startswith('pg'):
    61             form_fields = grok.AutoFields(ICustomPGApplicant)
    62             for field in PG_OMIT_DISPLAY_FIELDS:
     62        form_fields = grok.AutoFields(ICustomUGApplicant)
     63        if self.target is not None and self.target.startswith('fp'):
     64            for field in FP_OMIT_DISPLAY_FIELDS:
    6365                form_fields = form_fields.omit(field)
    6466        else:
    65             form_fields = grok.AutoFields(ICustomUGApplicant)
    6667            for field in UG_OMIT_DISPLAY_FIELDS:
    6768                form_fields = form_fields.omit(field)
     
    104105    @property
    105106    def form_fields(self):
    106         if self.target is not None and self.target.startswith('pg'):
    107             form_fields = grok.AutoFields(ICustomPGApplicant)
    108             for field in PG_OMIT_PDF_FIELDS:
     107        form_fields = grok.AutoFields(ICustomUGApplicant)
     108        if self.target is not None and self.target.startswith('fp'):
     109            for field in FP_OMIT_PDF_FIELDS:
    109110                form_fields = form_fields.omit(field)
    110111        else:
    111             form_fields = grok.AutoFields(ICustomUGApplicant)
    112112            for field in UG_OMIT_PDF_FIELDS:
    113113                form_fields = form_fields.omit(field)
     
    128128    @property
    129129    def form_fields(self):
    130         if self.target is not None and self.target.startswith('pg'):
    131             form_fields = grok.AutoFields(ICustomPGApplicant)
    132             for field in PG_OMIT_MANAGE_FIELDS:
     130        form_fields = grok.AutoFields(ICustomUGApplicant)
     131        if self.target is not None and self.target.startswith('fp'):
     132            for field in FP_OMIT_MANAGE_FIELDS:
    133133                form_fields = form_fields.omit(field)
    134134        else:
    135             form_fields = grok.AutoFields(ICustomUGApplicant)
    136135            for field in UG_OMIT_MANAGE_FIELDS:
    137136                form_fields = form_fields.omit(field)
     
    146145    @property
    147146    def form_fields(self):
    148         if self.target is not None and self.target.startswith('pg'):
    149             form_fields = grok.AutoFields(ICustomPGApplicantEdit)
    150             for field in PG_OMIT_EDIT_FIELDS:
     147        form_fields = grok.AutoFields(ICustomUGApplicantEdit)
     148        if self.target is not None and self.target.startswith('fp'):
     149            for field in FP_OMIT_EDIT_FIELDS:
    151150                form_fields = form_fields.omit(field)
    152151        else:
    153             form_fields = grok.AutoFields(ICustomUGApplicantEdit)
    154152            for field in UG_OMIT_EDIT_FIELDS:
    155153                form_fields = form_fields.omit(field)
Note: See TracChangeset for help on using the changeset viewer.