Ignore:
Timestamp:
3 Dec 2011, 05:09:21 (13 years ago)
Author:
Henrik Bettermann
Message:

Define formatDatetime (for displaying datetime objects in data tables) centrally in layout.py.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
3 edited

Legend:

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

    r7252 r7254  
    490490        return ''
    491491
    492     def formatDatetime(self,datetimeobj):
    493         if isinstance(datetimeobj, datetime):
    494             return datetimeobj.strftime("%Y-%m-%d %H:%M:%S")
    495         else:
    496             return None
    497 
    498492class AcceptanceFeePaymentAddPage(grok.View):
    499493    """ Page to add an online payment ticket
     
    889883        return
    890884
    891     def formatDatetime(self,datetimeobj):
    892         if isinstance(datetimeobj, datetime):
    893             return datetimeobj.strftime("%Y-%m-%d %H:%M:%S")
    894         else:
    895             return None
    896 
    897885    def unremovable(self, ticket):
    898886        usertype = getattr(self.request.principal, 'user_type', None)
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantdisplaypage.pt

    r7250 r7254  
    5959      <td> <a tal:attributes="href value/__name__">
    6060      <span tal:content="value/p_id">PID</span></a></td>
    61       <td tal:content="python: view.formatDatetime(value.creation_date)">CREATION DATE</td>
    62       <td tal:content="python: view.formatDatetime(value.payment_date)">PAYMENT DATE</td>
     61      <td tal:content="python: layout.formatDatetime(value.creation_date)">CREATION DATE</td>
     62      <td tal:content="python: layout.formatDatetime(value.payment_date)">PAYMENT DATE</td>
    6363      <td tal:content ="value/category">CATEGORY</td>
    6464      <td tal:content ="value/p_item">ITEM</td>
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicanteditpage.pt

    r7250 r7254  
    127127        <td> <a tal:attributes="href cl/__name__">
    128128        <span tal:content="cl/p_id">PID</span></a></td>
    129         <td tal:content="python: view.formatDatetime(cl.creation_date)">CREATION DATE</td>
    130         <td tal:content="python: view.formatDatetime(cl.payment_date)">PAYMENT DATE</td>
     129        <td tal:content="python: layout.formatDatetime(cl.creation_date)">CREATION DATE</td>
     130        <td tal:content="python: layout.formatDatetime(cl.payment_date)">PAYMENT DATE</td>
    131131      <td tal:content ="cl/category">CATEGORY</td>
    132132      <td tal:content ="cl/p_item">ITEM</td>
Note: See TracChangeset for help on using the changeset viewer.