Ignore:
Timestamp:
16 Apr 2012, 22:24:59 (13 years ago)
Author:
Henrik Bettermann
Message:

Use FormattedDate?.

File:
1 edited

Legend:

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

    r8144 r8184  
    1919from zope.formlib.textwidgets import BytesDisplayWidget
    2020from zope.component import getUtility
    21 from waeup.kofa.widgets.datewidget import (
    22     FriendlyDateWidget, FriendlyDateDisplayWidget
    23     )
    2421from waeup.kofa.interfaces import IExtFileStore
    2522from waeup.kofa.students.browser import (
     
    8885        if cm is not None and cm.startswith('pg'):
    8986            form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
    90             form_fields['emp_start'].custom_widget = FriendlyDateDisplayWidget('le')
    91             form_fields['emp_end'].custom_widget = FriendlyDateDisplayWidget('le')
    92             form_fields['emp2_start'].custom_widget = FriendlyDateDisplayWidget('le')
    93             form_fields['emp2_end'].custom_widget = FriendlyDateDisplayWidget('le')
    9487        else:
    9588            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
    96         form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    97         form_fields['fst_sit_date'].custom_widget = FriendlyDateDisplayWidget('le')
    98         form_fields['scd_sit_date'].custom_widget = FriendlyDateDisplayWidget('le')
    99         form_fields['scd_sit_date'].custom_widget = FriendlyDateDisplayWidget('le')
    100         form_fields['alr_date'].custom_widget = FriendlyDateDisplayWidget('le')
    10189        return form_fields
    10290
     
    11199        if cm is not None and cm.startswith('pg'):
    112100            form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
    113             form_fields['emp_start'].custom_widget = FriendlyDateDisplayWidget('le')
    114             form_fields['emp_end'].custom_widget = FriendlyDateDisplayWidget('le')
    115             form_fields['emp2_start'].custom_widget = FriendlyDateDisplayWidget('le')
    116             form_fields['emp2_end'].custom_widget = FriendlyDateDisplayWidget('le')
    117101        else:
    118102            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
    119         form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    120         form_fields['fst_sit_date'].custom_widget = FriendlyDateDisplayWidget('le')
    121         form_fields['scd_sit_date'].custom_widget = FriendlyDateDisplayWidget('le')
    122         form_fields['scd_sit_date'].custom_widget = FriendlyDateDisplayWidget('le')
    123         form_fields['alr_date'].custom_widget = FriendlyDateDisplayWidget('le')
    124103        return form_fields
    125104
     
    134113        if cm is not None and cm.startswith('pg'):
    135114            form_fields = grok.AutoFields(IPGStudentClearance)
    136             form_fields['emp_start'].custom_widget = FriendlyDateWidget('le-year')
    137             form_fields['emp_end'].custom_widget = FriendlyDateWidget('le-year')
    138             form_fields['emp2_start'].custom_widget = FriendlyDateWidget('le-year')
    139             form_fields['emp2_end'].custom_widget = FriendlyDateWidget('le-year')
    140115        else:
    141116            form_fields = grok.AutoFields(IUGStudentClearance)
    142         form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    143         form_fields['fst_sit_date'].custom_widget = FriendlyDateWidget('le-year')
    144         form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
    145         form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
    146         form_fields['alr_date'].custom_widget = FriendlyDateWidget('le-year')
    147 
    148 
    149117        return form_fields
    150118
     
    159127        if cm is not None and cm.startswith('pg'):
    160128            form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
    161             form_fields['emp_start'].custom_widget = FriendlyDateWidget('le-year')
    162             form_fields['emp_end'].custom_widget = FriendlyDateWidget('le-year')
    163             form_fields['emp2_start'].custom_widget = FriendlyDateWidget('le-year')
    164             form_fields['emp2_end'].custom_widget = FriendlyDateWidget('le-year')
    165129        else:
    166130            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
    167         form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    168         form_fields['fst_sit_date'].custom_widget = FriendlyDateWidget('le-year')
    169         form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
    170         form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
    171         form_fields['alr_date'].custom_widget = FriendlyDateWidget('le-year')
    172131        return form_fields
    173132
Note: See TracChangeset for help on using the changeset viewer.