I have got the following model:
db.define_table('event', SQLField('bedrijf', db.bedrijf, default='', notnull=True), SQLField('event', length=54, default='', notnull=True), SQLField('datum', type='date', default='', notnull=True,), SQLField('einddatum', type='date'), SQLField('duur', length=12), SQLField('plaats', length=42), SQLField('locatie', length=54), SQLField('omschrijving', type='text'), SQLField('eventtype', length=24), SQLField('doelgroep', length=24), SQLField('scope', length=24), migrate=False) db.event.bedrijf.requires=IS_IN_DB(db, db.bedrijf.id, '%(bedrijfsnaam) s') db.event.event.requires=[IS_LENGTH(54), IS_NOT_EMPTY()] db.event.datum.requires=[IS_DATE('%d-%m-%Y'), IS_NOT_EMPTY()] db.event.einddatum.requires=IS_DATE('%d-%m-%Y') db.event.duur.requires=IS_LENGTH(12) db.adres.plaats.requires=IS_IN_DB(db, db.plaats.plaats, '%(plaats)s') db.event.locatie.requires=IS_LENGTH(54) db.event.eventtype.requires=IS_IN_DB(db, db.eventtype.eventtype, '% (eventtype)s') db.event.doelgroep.requires=IS_IN_SET (['Consumer','Business','Employee']) db.event.scope.requires=IS_IN_SET(['Extern','Intern']) When I insert an event through database db table event (i.e.http:// 127.0.0.1:8000/core/appadmin/insert/db/event) the date inserted into PostgreSQL is formatted correctly e.g. 26-04-2009. However, when I expose the event function in the following view: <div id="primarycolumn"> <div id="dt_example"> {{if not events:}} <div class="flash"> {{=response.flash}} </div> <!-- flash --> {{else:}} <table id="example" class="display"> <thead> <tr> <th>event</th> <th>datum</th> <th>locatie</th> <th>event type</th> </tr> </thead> <tbody> {{for event in events:}} <tr> <td> {{=A(event.event,_href="javascript:eventlistdetails ('%s')" %URL(r=request,f='details',args= [event.id]),_target="_blank")}} </td> <td> {{=event.datum}} </td> <td> {{=event.locatie}} </td> <td> {{=event.eventtype}} </td> </tr> {{pass}} </tbody> </table> {{pass}} </div> <!-- dt_example --> </div> <!-- primarycolumn --> the date reads like 2009-04-26. The html table above is linked with the dataTables plugin on jQuery. Does one of you know how to get the date formatted correctly in this case? Kind regards, Annet. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---