Ignore:
Timestamp:
17 Apr 2012, 06:58:31 (13 years ago)
Author:
Henrik Bettermann
Message:

Remove custom_widget setting for phone numbers in views. Overriding the PhoneWidget? registration for the PhoneNumber? schema field should help. But it doesn't work at the moment.

File:
1 edited

Legend:

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

    r8184 r8187  
    1919"""
    2020import grok
    21 from waeup.uniben.widgets.phonewidget import PhoneWidget
    2221from waeup.kofa.applicants.interfaces import (
    2322    IApplicantRegisterUpdate, IApplicant, IApplicantEdit)
     
    5857        return form_fields
    5958
    60 class ApplicantAddFormPage(ApplicantAddFormPage):
    61     """Add-form to add an applicant.
    62     """
    63     form_fields = grok.AutoFields(IApplicant).select(
    64         'firstname', 'middlename', 'lastname',
    65         'email', 'phone')
    66     form_fields['phone'].custom_widget = PhoneWidget
    67 
    6859class ApplicantDisplayFormPage(ApplicantDisplayFormPage):
    6960    """A display view for applicant data.
     
    9283        else:
    9384            form_fields = grok.AutoFields(IUGApplicant)
    94         form_fields['phone'].custom_widget = PhoneWidget
    9585        form_fields['student_id'].for_display = True
    9686        form_fields['applicant_id'].for_display = True
     
    114104                'screening_score'
    115105                )
    116         form_fields['phone'].custom_widget = PhoneWidget
    117106        form_fields['applicant_id'].for_display = True
    118107        form_fields['reg_number'].for_display = True
    119108        return form_fields
    120 
    121 class ApplicantRegistrationPage(ApplicantRegistrationPage):
    122     """Captcha'd registration page for applicants.
    123     """
    124 
    125     @property
    126     def form_fields(self):
    127         form_fields = None
    128         if self.context.mode == 'create':
    129             form_fields = grok.AutoFields(IApplicantEdit).select(
    130                 'firstname', 'middlename', 'lastname', 'email', 'phone')
    131             form_fields['phone'].custom_widget = PhoneWidget
    132         elif self.context.mode == 'update':
    133             form_fields = grok.AutoFields(IApplicantRegisterUpdate).select(
    134                 'firstname','reg_number','email')
    135         return form_fields
Note: See TracChangeset for help on using the changeset viewer.