Ignore:
Timestamp:
26 Jul 2012, 06:23:18 (12 years ago)
Author:
Henrik Bettermann
Message:

Add PUDE 'omit' tuples.

File:
1 edited

Legend:

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

    r9050 r9054  
    2222from zope.i18n import translate
    2323from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
     24from zope.formlib.textwidgets import BytesDisplayWidget
    2425from waeup.kofa.students.interfaces import IStudentsUtils
    2526from waeup.kofa.applicants.interfaces import (
     
    3940    INigeriaPGApplicantEdit, INigeriaUGApplicantEdit,
    4041    INigeriaApplicantOnlinePayment,IPUTMEApplicantEdit,
    41     UG_OMIT_DISPLAY_FIELDS, PUTME_OMIT_DISPLAY_FIELDS, PG_OMIT_DISPLAY_FIELDS,
    42     UG_OMIT_PDF_FIELDS, PUTME_OMIT_PDF_FIELDS, PG_OMIT_PDF_FIELDS,
    43     UG_OMIT_MANAGE_FIELDS, PUTME_OMIT_MANAGE_FIELDS, PG_OMIT_MANAGE_FIELDS,
    44     UG_OMIT_EDIT_FIELDS, PG_OMIT_EDIT_FIELDS, PUTME_OMIT_EDIT_FIELDS,
    45     PUTME_OMIT_RESULT_SLIP_FIELDS)
     42    UG_OMIT_DISPLAY_FIELDS,
     43    UG_OMIT_PDF_FIELDS,
     44    UG_OMIT_MANAGE_FIELDS,
     45    UG_OMIT_EDIT_FIELDS,
     46    PG_OMIT_DISPLAY_FIELDS,
     47    PG_OMIT_PDF_FIELDS,
     48    PG_OMIT_MANAGE_FIELDS,
     49    PG_OMIT_EDIT_FIELDS,
     50    PUTME_OMIT_DISPLAY_FIELDS,
     51    PUTME_OMIT_PDF_FIELDS,
     52    PUTME_OMIT_MANAGE_FIELDS,
     53    PUTME_OMIT_EDIT_FIELDS,
     54    PUTME_OMIT_RESULT_SLIP_FIELDS,
     55    PUDE_OMIT_DISPLAY_FIELDS,
     56    PUDE_OMIT_PDF_FIELDS,
     57    PUDE_OMIT_MANAGE_FIELDS,
     58    PUDE_OMIT_EDIT_FIELDS,
     59    PUDE_OMIT_RESULT_SLIP_FIELDS,
     60    )
    4661from kofacustom.nigeria.interfaces import MessageFactory as _
    4762
     
    7893            for field in PUTME_OMIT_DISPLAY_FIELDS:
    7994                form_fields = form_fields.omit(field)
     95        elif target is not None and target.startswith('pude'):
     96            form_fields = grok.AutoFields(INigeriaUGApplicant)
     97            for field in PUDE_OMIT_DISPLAY_FIELDS:
     98                form_fields = form_fields.omit(field)
    8099        else:
    81100            form_fields = grok.AutoFields(INigeriaUGApplicant)
    82101            for field in UG_OMIT_DISPLAY_FIELDS:
    83102                form_fields = form_fields.omit(field)
     103        form_fields['perm_address'].custom_widget = BytesDisplayWidget
     104        form_fields['notice'].custom_widget = BytesDisplayWidget
    84105        return form_fields
    85106
     
    113134                for field in PUTME_OMIT_PDF_FIELDS:
    114135                    form_fields = form_fields.omit(field)
     136        elif target is not None and target.startswith('pude'):
     137            form_fields = grok.AutoFields(INigeriaUGApplicant)
     138            if self._reduced_slip():
     139                for field in PUDE_OMIT_RESULT_SLIP_FIELDS:
     140                    form_fields = form_fields.omit(field)
     141            else:
     142                for field in PUDE_OMIT_PDF_FIELDS:
     143                    form_fields = form_fields.omit(field)
    115144        else:
    116145            form_fields = grok.AutoFields(INigeriaUGApplicant)
     
    136165            for field in PUTME_OMIT_MANAGE_FIELDS:
    137166                form_fields = form_fields.omit(field)
     167        elif target is not None and target.startswith('pude'):
     168            form_fields = grok.AutoFields(INigeriaUGApplicant)
     169            for field in PUDE_OMIT_MANAGE_FIELDS:
     170                form_fields = form_fields.omit(field)
    138171        else:
    139172            form_fields = grok.AutoFields(INigeriaUGApplicant)
     
    158191            form_fields = grok.AutoFields(IPUTMEApplicantEdit)
    159192            for field in PUTME_OMIT_EDIT_FIELDS:
     193                form_fields = form_fields.omit(field)
     194        elif target is not None and target.startswith('pude'):
     195            form_fields = grok.AutoFields(INigeriaUGApplicant)
     196            for field in PUDE_OMIT_EDIT_FIELDS:
    160197                form_fields = form_fields.omit(field)
    161198        else:
Note: See TracChangeset for help on using the changeset viewer.