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.

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
3 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
  • main/waeup.uniben/trunk/src/waeup/uniben/browser/pages.py

    r8080 r8187  
    2424from waeup.kofa.browser.pages import (
    2525    UserEditFormPage, UserManageFormPage, AddUserFormPage)
    26 from waeup.uniben.widgets.phonewidget import PhoneWidget
    2726
    2827class SessionConfigurationAddFormPage(SessionConfigurationAddFormPage):
     
    3534    """
    3635    form_fields = grok.AutoFields(ISessionConfiguration)
    37 
    38 class AddUserFormPage(AddUserFormPage):
    39     """Add a user account.
    40     """
    41     form_fields = grok.AutoFields(IUserAccount)
    42     form_fields['phone'].custom_widget = PhoneWidget
    43 
    44 class UserManageFormPage(UserManageFormPage):
    45     """Manage a user account.
    46     """
    47     form_fields = grok.AutoFields(IUserAccount).omit('name')
    48     form_fields['phone'].custom_widget = PhoneWidget
    49 
    50 class UserEditFormPage(UserEditFormPage):
    51     """Edit a user account by user
    52     """
    53     form_fields = grok.AutoFields(IUserAccount).omit(
    54         'name', 'description', 'roles')
    55     form_fields['phone'].custom_widget = PhoneWidget
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r8184 r8187  
    3232    )
    3333from waeup.uniben.interfaces import MessageFactory as _
    34 from waeup.uniben.widgets.phonewidget import PhoneWidget
    3534
    3635class RequestCallbackActionButton(RequestCallbackActionButton):
     
    5150    """
    5251    form_fields = grok.AutoFields(IStudentBase).omit('student_id')
    53     form_fields['phone'].custom_widget = PhoneWidget
    5452
    5553class StudentBaseEditFormPage(StudentBaseEditFormPage):
     
    5856    form_fields = grok.AutoFields(IStudentBase).select(
    5957        'email', 'phone')
    60     form_fields['phone'].custom_widget = PhoneWidget
    6158
    6259
Note: See TracChangeset for help on using the changeset viewer.