Changeset 8128


Ignore:
Timestamp:
12 Apr 2012, 10:15:55 (13 years ago)
Author:
uli
Message:

Use one of the modes as fallback when displaying the registration view
for applicants. This way the view still works with older data.fs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r8096 r8128  
    225225    pnav = 3
    226226
    227     form_fields = grok.AutoFields(IApplicantsContainer).omit('title') 
     227    form_fields = grok.AutoFields(IApplicantsContainer).omit('title')
    228228    form_fields['startdate'].custom_widget = FriendlyDateDisplayWidget('le')
    229229    form_fields['enddate'].custom_widget = FriendlyDateDisplayWidget('le')
     
    874874    def form_fields(self):
    875875        form_fields = None
    876         if self.context.mode == 'create':
     876        if self.context.mode == 'update':
     877            form_fields = grok.AutoFields(IApplicantRegisterUpdate).select(
     878                'firstname','reg_number','email')
     879        else: #if self.context.mode == 'create':
    877880            form_fields = grok.AutoFields(IApplicantEdit).select(
    878881                'firstname', 'middlename', 'lastname', 'email', 'phone')
    879882            form_fields['phone'].custom_widget = PhoneWidget
    880         elif self.context.mode == 'update':
    881             form_fields = grok.AutoFields(IApplicantRegisterUpdate).select(
    882                 'firstname','reg_number','email')
     883
    883884        return form_fields
    884885
Note: See TracChangeset for help on using the changeset viewer.