Changeset 8184 for main/waeup.uniben


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
Files:
4 edited

Legend:

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

    r8090 r8184  
    1919"""
    2020import grok
    21 from waeup.kofa.widgets.datewidget import (
    22     FriendlyDateWidget, FriendlyDateDisplayWidget,
    23     FriendlyDatetimeDisplayWidget)
    2421from waeup.uniben.widgets.phonewidget import PhoneWidget
    2522from waeup.kofa.applicants.interfaces import (
     
    5956            form_fields = grok.AutoFields(IUGApplicant).omit(
    6057                'locked', 'course_admitted')
    61         form_fields[
    62             'date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    6358        return form_fields
    6459
     
    8479            form_fields = grok.AutoFields(IUGApplicant).omit(
    8580                'locked', 'course_admitted', 'password')
    86         form_fields[
    87             'date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    8881        return form_fields
    8982
     
    9790        if target is not None and target.startswith('pg'):
    9891            form_fields = grok.AutoFields(IPGApplicant)
    99             form_fields[
    100                 'emp_start'].custom_widget = FriendlyDateWidget('le-year')
    101             form_fields[
    102                 'emp_end'].custom_widget = FriendlyDateWidget('le-year')
    103             form_fields[
    104                 'emp2_start'].custom_widget = FriendlyDateWidget('le-year')
    105             form_fields[
    106                 'emp2_end'].custom_widget = FriendlyDateWidget('le-year')
    10792        else:
    10893            form_fields = grok.AutoFields(IUGApplicant)
    109         form_fields[
    110             'date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    11194        form_fields['phone'].custom_widget = PhoneWidget
    11295        form_fields['student_id'].for_display = True
     
    126109                'screening_score', 'screening_venue'
    127110                )
    128             form_fields[
    129                 'emp_start'].custom_widget = FriendlyDateWidget('le-year')
    130             form_fields[
    131                 'emp_end'].custom_widget = FriendlyDateWidget('le-year')
    132             form_fields[
    133                 'emp2_start'].custom_widget = FriendlyDateWidget('le-year')
    134             form_fields[
    135                 'emp2_end'].custom_widget = FriendlyDateWidget('le-year')
    136111        else:
    137112            form_fields = grok.AutoFields(IUGApplicantEdit).omit(
     
    139114                'screening_score'
    140115                )
    141         form_fields[
    142             'date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    143116        form_fields['phone'].custom_widget = PhoneWidget
    144117        form_fields['applicant_id'].for_display = True
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py

    r8101 r8184  
    2525from waeup.kofa.schoolgrades import ResultEntryField
    2626from waeup.kofa.interfaces import SimpleKofaVocabulary
     27from waeup.kofa.schema import FormattedDate
    2728from waeup.kofa.students.vocabularies import nats_vocab
    2829from waeup.uniben.interfaces import (
    2930    lgas_vocab, high_qual, high_grade, exam_types)
    3031from waeup.uniben.interfaces import MessageFactory as _
     32
    3133
    3234class IUGApplicant(IApplicantBaseData):
     
    150152        readonly = False,
    151153        )
    152     emp_start = schema.Date(
     154    emp_start = FormattedDate(
    153155        title = _(u'Start Date'),
    154156        required = False,
    155157        readonly = False,
    156158        )
    157     emp_end = schema.Date(
     159    emp_end = FormattedDate(
    158160        title = _(u'End Date'),
    159161        required = False,
     
    175177        readonly = False,
    176178        )
    177     emp2_start = schema.Date(
     179    emp2_start = FormattedDate(
    178180        title = _(u'Start Date'),
    179181        required = False,
    180182        readonly = False,
    181183        )
    182     emp2_end = schema.Date(
     184    emp2_end = FormattedDate(
    183185        title = _(u'End Date'),
    184186        required = False,
  • 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.