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

Legend:

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

    r7253 r7254  
    959959#    pnav = 4
    960960
    961 #    def formatDatetime(self,datetimeobj):
    962 #        if isinstance(datetimeobj, datetime):
    963 #            return datetimeobj.strftime("%Y-%m-%d %H:%M:%S")
    964 #        else:
    965 #            return None
    966 
    967961#    @property
    968962#    def label(self):
     
    991985            return False
    992986        return (self.request.principal.user_type == 'student' and ticket.r_code)
    993 
    994     def formatDatetime(self,datetimeobj):
    995         if isinstance(datetimeobj, datetime):
    996             return datetimeobj.strftime("%Y-%m-%d %H:%M:%S")
    997         else:
    998             return None
    999987
    1000988    @property
     
    12581246    pnav = 4
    12591247    officers_only_actions = ['Remove selected']
    1260 
    1261     def formatDatetime(self,datetimeobj):
    1262         if isinstance(datetimeobj, datetime):
    1263             return datetimeobj.strftime("%Y-%m-%d %H:%M:%S")
    1264         else:
    1265             return None
    12661248
    12671249    @property
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/accommodationmanagepage.pt

    r7240 r7254  
    3434        <td> <a tal:attributes="href cl/__name__">
    3535        <span tal:content="python: cl.getSessionString()">PID</span></a></td>
    36         <td tal:content="python: view.formatDatetime(cl.booking_date)">DATE</td>
     36        <td tal:content="python: layout.formatDatetime(cl.booking_date)">DATE</td>
    3737        <td tal:content="cl/bed_coordinates">COORDINATES</td>
    3838        <td tal:content="cl/bed_type">TYPE</td>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/paymentsmanagepage.pt

    r6940 r7254  
    3737        <td> <a tal:attributes="href cl/__name__">
    3838        <span tal:content="cl/p_id">PID</span></a></td>
    39         <td tal:content="python: view.formatDatetime(cl.creation_date)">CREATION DATE</td>
    40         <td tal:content="python: view.formatDatetime(cl.payment_date)">PAYMENT DATE</td>
     39        <td tal:content="python: layout.formatDatetime(cl.creation_date)">CREATION DATE</td>
     40        <td tal:content="python: layout.formatDatetime(cl.payment_date)">PAYMENT DATE</td>
    4141      <td tal:content ="cl/category">CATEGORY</td>
    4242      <td tal:content ="cl/p_item">ITEM</td>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/paymentspage.pt

    r6869 r7254  
    1919      <td> <a tal:attributes="href value/__name__">
    2020      <span tal:content="value/p_id">PID</span></a></td>
    21       <td tal:content="python: view.formatDatetime(value.creation_date)">CREATION DATE</td>
    22       <td tal:content="python: view.formatDatetime(value.payment_date)">PAYMENT DATE</td>
     21      <td tal:content="python: layout.formatDatetime(value.creation_date)">CREATION DATE</td>
     22      <td tal:content="python: layout.formatDatetime(value.payment_date)">PAYMENT DATE</td>
    2323      <td tal:content ="value/category">CATEGORY</td>
    2424      <td tal:content ="value/p_item">ITEM</td>
Note: See TracChangeset for help on using the changeset viewer.