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

Use FormattedDate?.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
2 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
  • main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py

    r8136 r8184  
    1919from waeup.kofa.schema import TextLineChoice
    2020from waeup.kofa.interfaces import SimpleKofaVocabulary
     21from waeup.kofa.schema import FormattedDate
    2122from waeup.kofa.schoolgrades import ResultEntryField
    2223from waeup.kofa.students.vocabularies import nats_vocab
     
    6162
    6263    """
    63     date_of_birth = schema.Date(
     64    date_of_birth = FormattedDate(
    6465        title = _(u'Date of Birth'),
    6566        required = False,
     
    9596        )
    9697
    97     fst_sit_date = schema.Date(
     98    fst_sit_date = FormattedDate(
    9899        title = _(u'Exam Date'),
    99100        required = False,
     
    127128        )
    128129
    129     scd_sit_date = schema.Date(
     130    scd_sit_date = FormattedDate(
    130131        title = _(u'Exam Date'),
    131132        required = False,
     
    159160        )
    160161
    161     alr_date = schema.Date(
     162    alr_date = FormattedDate(
    162163        title = _(u'Exam Date'),
    163164        required = False,
     
    279280        )
    280281
    281     emp_start = schema.Date(
     282    emp_start = FormattedDate(
    282283        title = _(u'Start Date'),
    283284        required = False,
     
    285286        )
    286287
    287     emp_end = schema.Date(
     288    emp_end = FormattedDate(
    288289        title = _(u'End Date'),
    289290        required = False,
     
    309310        )
    310311
    311     emp2_start = schema.Date(
     312    emp2_start = FormattedDate(
    312313        title = _(u'Start Date'),
    313314        required = False,
    314315        readonly = False,
    315316        )
    316     emp2_end = schema.Date(
     317    emp2_end = FormattedDate(
    317318        title = _(u'End Date'),
    318319        required = False,
Note: See TracChangeset for help on using the changeset viewer.