Changeset 13277


Ignore:
Timestamp:
24 Sep 2015, 07:35:23 (9 years ago)
Author:
Henrik Bettermann
Message:

Define and use PRE_OMIT_FIELDS.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants
Files:
2 edited

Legend:

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

    r13155 r13277  
    6161    PUDE_OMIT_EDIT_FIELDS,
    6262    PUDE_OMIT_RESULT_SLIP_FIELDS,
     63    PRE_OMIT_DISPLAY_FIELDS,
     64    PRE_OMIT_PDF_FIELDS,
     65    PRE_OMIT_MANAGE_FIELDS,
     66    PRE_OMIT_EDIT_FIELDS,
    6367    )
    6468from kofacustom.nigeria.interfaces import MessageFactory as _
     
    9094            for field in PG_OMIT_DISPLAY_FIELDS:
    9195                form_fields = form_fields.omit(field)
    92         # Don't know what pre-degree studies are, seems to be pre-postgraduate.
    93         # Many modifications are expected. Therefore, we need a dedicated
    94         # elif statement (see also pages below)
    95         elif self.target is not None and self.target.startswith('pre'):
    96             form_fields = grok.AutoFields(INigeriaPGApplicant)
    97             for field in PG_OMIT_DISPLAY_FIELDS:
     96        elif self.target is not None and self.target.startswith('pre'):
     97            form_fields = grok.AutoFields(INigeriaPGApplicant)
     98            for field in PRE_OMIT_DISPLAY_FIELDS:
    9899                form_fields = form_fields.omit(field)
    99100        elif self.target is not None and self.target.startswith('cbt'):
     
    144145        elif self.target is not None and self.target.startswith('pre'):
    145146            form_fields = grok.AutoFields(INigeriaPGApplicant)
    146             for field in PG_OMIT_PDF_FIELDS:
     147            for field in PRE_OMIT_PDF_FIELDS:
    147148                form_fields = form_fields.omit(field)
    148149        elif self.target is not None and self.target.startswith('cbt'):
     
    192193        elif self.target is not None and self.target.startswith('pre'):
    193194            form_fields = grok.AutoFields(INigeriaPGApplicant)
    194             for field in PG_OMIT_MANAGE_FIELDS:
     195            for field in PRE_OMIT_MANAGE_FIELDS:
    195196                form_fields = form_fields.omit(field)
    196197        elif self.target is not None and self.target.startswith('cbt'):
     
    226227        elif self.target is not None and self.target.startswith('pre'):
    227228            form_fields = grok.AutoFields(INigeriaPGApplicantEdit)
    228             for field in PG_OMIT_EDIT_FIELDS:
     229            for field in PRE_OMIT_EDIT_FIELDS:
    229230                form_fields = form_fields.omit(field)
    230231        elif self.target is not None and self.target.startswith('cbt'):
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/interfaces.py

    r13163 r13277  
    2121from zope import schema
    2222from zope.component import getUtility
     23from zope.schema import getFields
    2324from waeup.kofa.applicants.interfaces import (
    2425    contextual_reg_num_source,
     
    543544    'locked'].order =  IApplicantBaseData['suspended'].order
    544545
     546# PRE is used by Uniben
     547#  med: "it is as named... PRE - DEGREE... much like a 1 year diploma programme"
     548PRE_OMIT_FIELDS = tuple([
     549    i for i in getFields(INigeriaPGApplicant).keys()
     550        if i[:3] in ('hq_', 'emp', 'nys')])
     551PRE_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PRE_OMIT_FIELDS
     552PRE_OMIT_MANAGE_FIELDS = PG_OMIT_MANAGE_FIELDS + PRE_OMIT_FIELDS
     553PRE_OMIT_EDIT_FIELDS = set(PG_OMIT_EDIT_FIELDS + PRE_OMIT_FIELDS)
     554PRE_OMIT_PDF_FIELDS = PRE_OMIT_DISPLAY_FIELDS
     555PRE_OMIT_RESULT_SLIP_FIELDS = PRE_OMIT_DISPLAY_FIELDS
     556
    545557class INigeriaApplicant(INigeriaUGApplicant, INigeriaPGApplicant):
    546558    """An interface for both types of applicants.
Note: See TracChangeset for help on using the changeset viewer.