Ignore:
Timestamp:
24 May 2013, 07:37:21 (11 years ago)
Author:
Henrik Bettermann
Message:

Use target property.

File:
1 edited

Legend:

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

    r9985 r10223  
    8080    @property
    8181    def form_fields(self):
    82         target = getattr(self.context.__parent__, 'prefix', None)
    83         if target is not None and target.startswith('pg'):
     82        if self.target is not None and self.target.startswith('pg'):
    8483            form_fields = grok.AutoFields(INigeriaPGApplicant)
    8584            for field in PG_OMIT_DISPLAY_FIELDS:
    8685                form_fields = form_fields.omit(field)
    87         elif target is not None and target.startswith('putme'):
     86        elif self.target is not None and self.target.startswith('putme'):
    8887            form_fields = grok.AutoFields(INigeriaUGApplicant)
    8988            for field in PUTME_OMIT_DISPLAY_FIELDS:
    9089                form_fields = form_fields.omit(field)
    91         elif target is not None and target.startswith('pude'):
     90        elif self.target is not None and self.target.startswith('pude'):
    9291            form_fields = grok.AutoFields(INigeriaUGApplicant)
    9392            for field in PUDE_OMIT_DISPLAY_FIELDS:
     
    116115    #@property
    117116    #def note(self):
    118     #    target = getattr(self.context.__parent__, 'prefix', None)
    119     #    if target is not None and not target.startswith('pg') \
     117    #    if self.target is not None and not self.target.startswith('pg') \
    120118    #        and not self._reduced_slip():
    121119    #        return _(u'<br /><br /><br />'
     
    125123    @property
    126124    def form_fields(self):
    127         target = getattr(self.context.__parent__, 'prefix', None)
    128         if target is not None and target.startswith('pg'):
     125        if self.target is not None and self.target.startswith('pg'):
    129126            form_fields = grok.AutoFields(INigeriaPGApplicant)
    130127            for field in PG_OMIT_PDF_FIELDS:
    131128                form_fields = form_fields.omit(field)
    132         elif target is not None and target.startswith('putme'):
     129        elif self.target is not None and self.target.startswith('putme'):
    133130            form_fields = grok.AutoFields(INigeriaUGApplicant)
    134131            if self._reduced_slip():
     
    138135                for field in PUTME_OMIT_PDF_FIELDS:
    139136                    form_fields = form_fields.omit(field)
    140         elif target is not None and target.startswith('pude'):
     137        elif self.target is not None and self.target.startswith('pude'):
    141138            form_fields = grok.AutoFields(INigeriaUGApplicant)
    142139            if self._reduced_slip():
     
    166163    @property
    167164    def form_fields(self):
    168         target = getattr(self.context.__parent__, 'prefix', None)
    169         if target is not None and target.startswith('pg'):
     165        if self.target is not None and self.target.startswith('pg'):
    170166            form_fields = grok.AutoFields(INigeriaPGApplicant)
    171167            for field in PG_OMIT_MANAGE_FIELDS:
    172168                form_fields = form_fields.omit(field)
    173         elif target is not None and target.startswith('putme'):
     169        elif self.target is not None and self.target.startswith('putme'):
    174170            form_fields = grok.AutoFields(INigeriaUGApplicant)
    175171            for field in PUTME_OMIT_MANAGE_FIELDS:
    176172                form_fields = form_fields.omit(field)
    177         elif target is not None and target.startswith('pude'):
     173        elif self.target is not None and self.target.startswith('pude'):
    178174            form_fields = grok.AutoFields(INigeriaUGApplicant)
    179175            for field in PUDE_OMIT_MANAGE_FIELDS:
     
    193189    @property
    194190    def form_fields(self):
    195         target = getattr(self.context.__parent__, 'prefix', None)
    196         if target is not None and target.startswith('pg'):
     191        if self.target is not None and self.target.startswith('pg'):
    197192            form_fields = grok.AutoFields(INigeriaPGApplicantEdit)
    198193            for field in PG_OMIT_EDIT_FIELDS:
    199194                form_fields = form_fields.omit(field)
    200         elif target is not None and target.startswith('putme'):
     195        elif self.target is not None and self.target.startswith('putme'):
    201196            form_fields = grok.AutoFields(IPUTMEApplicantEdit)
    202197            for field in PUTME_OMIT_EDIT_FIELDS:
    203198                form_fields = form_fields.omit(field)
    204         elif target is not None and target.startswith('pude'):
     199        elif self.target is not None and self.target.startswith('pude'):
    205200            form_fields = grok.AutoFields(INigeriaUGApplicantEdit)
    206201            for field in PUDE_OMIT_EDIT_FIELDS:
Note: See TracChangeset for help on using the changeset viewer.