Changeset 8160


Ignore:
Timestamp:
15 Apr 2012, 06:40:01 (13 years ago)
Author:
Henrik Bettermann
Message:

Use new date and datetime widgets everywhere in base package.

Use standard datetime widgets for imports. I don't know if this is really necessary.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/interfaces.py

    r7819 r8160  
    2222from waeup.kofa.interfaces import IKofaObject
    2323from waeup.kofa.interfaces import MessageFactory as _
     24from waeup.kofa.schema import FormattedDate
    2425
    2526class IAccessCode(IKofaObject):
     
    6061    """A factory for batches of access codes.
    6162    """
    62     creation_date = schema.Date(
     63    creation_date = FormattedDate(
    6364        title = _(u'Creation date'),
    6465        )
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r8150 r8160  
    5252from waeup.kofa.students.interfaces import IStudentsUtils
    5353from waeup.kofa.utils.helpers import string_from_bytes, file_size
    54 from waeup.kofa.widgets.datewidget import (
    55     FriendlyDateWidget, FriendlyDateDisplayWidget,
    56     FriendlyDatetimeDisplayWidget)
     54from waeup.kofa.widgets.datewidget import FriendlyDateDisplayWidget
    5755from waeup.kofa.widgets.phonewidget import PhoneWidget
    5856from waeup.kofa.widgets.restwidget import ReSTDisplayWidget
     
    153151    form_fields = grok.AutoFields(
    154152        IApplicantsContainerAdd).omit('code').omit('title')
    155     form_fields['startdate'].custom_widget = FriendlyDateWidget('le')
    156     form_fields['enddate'].custom_widget = FriendlyDateWidget('le')
    157153
    158154    def update(self):
     
    226222
    227223    form_fields = grok.AutoFields(IApplicantsContainer).omit('title')
    228     form_fields['startdate'].custom_widget = FriendlyDateDisplayWidget('le')
    229     form_fields['enddate'].custom_widget = FriendlyDateDisplayWidget('le')
    230224    form_fields['description'].custom_widget = ReSTDisplayWidget
    231225
     
    257251    tabthreeactions2 = [_('Add local role')]
    258252    # Use friendlier date widget...
    259     form_fields['startdate'].custom_widget = FriendlyDateWidget('le')
    260     form_fields['enddate'].custom_widget = FriendlyDateWidget('le')
    261253    grok.require('waeup.manageApplication')
    262254
     
    497489    grok.require('waeup.viewApplication')
    498490    form_fields = grok.AutoFields(IApplicantOnlinePayment)
    499     form_fields[
    500         'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    501     form_fields[
    502         'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    503491    pnav = 3
    504492
     
    546534    grok.require('waeup.viewApplication')
    547535    form_fields = grok.AutoFields(IApplicantOnlinePayment)
    548     form_fields['creation_date'].custom_widget = FriendlyDateDisplayWidget('le')
    549     form_fields['payment_date'].custom_widget = FriendlyDateDisplayWidget('le')
     536    #form_fields['creation_date'].custom_widget = FriendlyDateDisplayWidget('le')
     537    #form_fields['payment_date'].custom_widget = FriendlyDateDisplayWidget('le')
    550538    prefix = 'form'
    551539
     
    754742        'screening_score',
    755743        )
    756     form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    757744    form_fields['phone'].custom_widget = PhoneWidget
    758745    form_fields['applicant_id'].for_display = True
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r8154 r8160  
    221221        """Content as language dictionary with values in HTML format.""")
    222222
    223     startdate = schema.Date(
     223    startdate = FormattedDate(
    224224        title = _(u'Application Start Date'),
    225225        required = False,
    226         )
    227 
    228     enddate = schema.Date(
     226        show_year = False,
     227        )
     228
     229    enddate = FormattedDate(
    229230        title = _(u'Application Closing Date'),
    230231        required = False,
     232        show_year = False,
    231233        )
    232234
  • main/waeup.kofa/trunk/src/waeup/kofa/payments/interfaces.py

    r7931 r8160  
    2020from waeup.kofa.interfaces import IKofaObject, SimpleKofaVocabulary
    2121from waeup.kofa.interfaces import MessageFactory as _
     22from waeup.kofa.schema import FormattedDatetime
    2223
    2324payment_states = SimpleKofaVocabulary(
     
    6869        )
    6970
    70     creation_date = schema.Datetime(
     71    creation_date = FormattedDatetime(
    7172        title = _(u'Ticket Creation Date'),
    7273        readonly = False,
    7374        )
    7475
    75     payment_date = schema.Datetime(
     76    payment_date = FormattedDatetime(
    7677        title = _(u'Payment Date'),
    7778        required = False,
     
    171172        readonly = False,
    172173        )
     174
     175class IOnlinePaymentImportExport(IOnlinePayment):
     176    """A base representation of payments.
     177
     178    """
     179
     180    creation_date = schema.Datetime(
     181        title = _(u'Ticket Creation Date'),
     182        readonly = False,
     183        )
     184
     185    payment_date = schema.Datetime(
     186        title = _(u'Payment Date'),
     187        required = False,
     188        readonly = False,
     189        )
     190
     191
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r7959 r8160  
    4040    IStudentUpdateByRegNo, IStudentUpdateByMatricNo,
    4141    IStudentStudyLevel, ICourseTicket,
    42     IStudentOnlinePayment, IStudentVerdictUpdate)
     42    IStudentOnlinePaymentImportExport, IStudentVerdictUpdate)
    4343from waeup.kofa.students.workflow import  IMPORTABLE_STATES
    4444from waeup.kofa.utils.batching import BatchProcessor
     
    539539
    540540    name = u'Payment Processor'
    541     iface = IStudentOnlinePayment
     541    iface = IStudentOnlinePaymentImportExport
    542542    factory_name = 'waeup.StudentOnlinePayment'
    543543
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r8143 r8160  
    4545    IKofaUtils, IUniversity)
    4646from waeup.kofa.interfaces import MessageFactory as _
    47 from waeup.kofa.widgets.datewidget import (
    48     FriendlyDateWidget, FriendlyDateDisplayWidget,
    49     FriendlyDatetimeDisplayWidget)
     47from waeup.kofa.widgets.datewidget import FriendlyDateDisplayWidget
    5048from waeup.kofa.widgets.restwidget import ReSTDisplayWidget
    5149from waeup.kofa.widgets.phonewidget import PhoneWidget
     
    419417        else:
    420418            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
    421         form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    422419        return form_fields
    423420
     
    442439        else:
    443440            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
    444         form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    445441        return form_fields
    446442
     
    487483        else:
    488484            form_fields = grok.AutoFields(IUGStudentClearance)
    489         form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    490485        return form_fields
    491486
     
    11191114    grok.require('waeup.viewStudent')
    11201115    form_fields = grok.AutoFields(IStudentOnlinePayment)
    1121     form_fields[
    1122         'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    1123     form_fields[
    1124         'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    11251116    pnav = 4
    11261117
     
    11891180    grok.require('waeup.viewStudent')
    11901181    form_fields = grok.AutoFields(IStudentOnlinePayment)
    1191     form_fields['creation_date'].custom_widget = FriendlyDateDisplayWidget('le')
    1192     form_fields['payment_date'].custom_widget = FriendlyDateDisplayWidget('le')
     1182    #form_fields['creation_date'].custom_widget = FriendlyDateDisplayWidget('le')
     1183    #form_fields['payment_date'].custom_widget = FriendlyDateDisplayWidget('le')
    11931184    prefix = 'form'
    11941185    title = 'Payment Data'
     
    13761367    grok.require('waeup.handleAccommodation')
    13771368    form_fields = grok.AutoFields(IBedTicket)
    1378     form_fields[
    1379         'booking_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    13801369    pnav = 4
    13811370
     
    13921381    grok.require('waeup.handleAccommodation')
    13931382    form_fields = grok.AutoFields(IBedTicket)
    1394     form_fields['booking_date'].custom_widget = FriendlyDateDisplayWidget('le')
     1383    #form_fields['booking_date'].custom_widget = FriendlyDateDisplayWidget('le')
    13951384    prefix = 'form'
    13961385
     
    16431632        else:
    16441633            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
    1645         form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    16461634        return form_fields
    16471635
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r8057 r8160  
    2929
    3030class StudentsExporter(grok.GlobalUtility, ExporterBase):
    31     """Exporter for Applicants.
     31    """Exporter for Students.
    3232    """
    3333    grok.implements(ICSVExporter)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r8069 r8160  
    2424    IKofaObject, academic_sessions_vocab, validate_email, IKofaUtils)
    2525from waeup.kofa.interfaces import MessageFactory as _
    26 from waeup.kofa.schema import TextLineChoice
     26from waeup.kofa.schema import TextLineChoice, FormattedDate, FormattedDatetime
    2727from waeup.kofa.students.vocabularies import (
    2828    StudyLevelSource, contextual_reg_num_source, contextual_mat_num_source,
    2929    GenderSource, nats_vocab,
    3030    )
    31 from waeup.kofa.payments.interfaces import IPaymentsContainer, IOnlinePayment
     31from waeup.kofa.payments.interfaces import (
     32    IPaymentsContainer, IOnlinePayment, IOnlinePaymentImportExport)
    3233from waeup.kofa.university.vocabularies import (
    3334    CourseSource, StudyModeSource, CertificateSource)
     
    215216
    216217    """
    217     date_of_birth = schema.Date(
     218    date_of_birth = FormattedDate(
    218219        title = _(u'Date of Birth'),
    219220        required = True,
     221        show_year = True,
    220222        )
    221223
     
    465467        )
    466468
    467     booking_date = schema.Datetime(
     469    booking_date = FormattedDatetime(
    468470        title = _(u'Booking Date'),
    469471        required = False,
     
    500502    'p_item'].order
    501503
     504
     505class IStudentOnlinePaymentImportExport(IOnlinePaymentImportExport):
     506    """A student payment for import and export.
     507
     508    """
     509    p_session = schema.Choice(
     510        title = _(u'Payment Session'),
     511        source = academic_sessions_vocab,
     512        required = False,
     513        )
     514
    502515class IStudentChangePassword(IKofaObject):
    503516    """Interface needed for change pasword page.
    504517
    505518    """
    506 
    507519    reg_number = schema.TextLine(
    508520        title = _(u'Registration Number'),
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_payment_data.csv

    r7626 r8160  
    11p_state,p_category,r_pay_reference,r_desc,p_id,reg_number,session_id,r_amount_approved,p_item,amount_auth,r_card_num,r_code,creation_date,type,surcharge_1
    22paid,schoolfee,GTB|WEB|FUT|26-11-2010|002295,Approved Successful,3816951290797973744#,1,2010,19500,BTECHBDT,19500,0942,00,2010/11/26 19:59:33.744 GMT+1,online,0
    3 unpaid,schoolfee,GTB|WEB|FUT|25-11-2010|,Transaction status unconfirmed,3816951290712593757,2,2010,0,BTECHBDT,19500,0942,Z0,2010/11/25 20:16:33.757 GMT+1,online,0
    4 paid,schoolfee,UBA|WEB|FUT|15-02-2010|000517,Approved Successful,p1266236341955,3,2009,19500,BTECHBDT,19500,0615,00,2010/02/15 13:19:01.955 GMT+1,online,0
     3unpaid,schoolfee,GTB|WEB|FUT|25-11-2010|,Transaction status unconfirmed,3816951290712593757,2,2010,0,BTECHBDT,19500,0942,Z0,2010-11-25 20:16:33.757 GMT+1,online,0
     4paid,schoolfee,UBA|WEB|FUT|15-02-2010|000517,Approved Successful,p1266236341955,3,2009,19500,BTECHBDT,19500,0615,00,2010/02/15 13:19:01,online,0
Note: See TracChangeset for help on using the changeset viewer.