db.lot.start_date.requires = IS_DATE(format=T('%Y-%m-%d'),error_message=T('must be YYYY-MM-DD!'))
And I have a custom CSV import that implies multiple tables including this one.
db.lot.insert(
name=line["NAME"],
start_date=line["S_DATE"]
)
(line is a csv row)
However the S_DATE column has format DD/MM/YYYY
I'm working with git trunk and using Postgres and (magically?) all imported dates are correct, I mean, there are no errors and there is no confusion between dd/mm/yyyy and mm/dd/yyyy for dates like 06/04/2012
How this can be possible? It's because of my development machine or postgres locale? (My language file is not in web2py yet so the web interface is in english and so the date format in admin app database administration is yyyy-mm-dd, just to clarify that this is not because of T in format)
Anyway, the question is how can I define/ensure that such dates will be always well inserted when importing the CSV?
Because looks like the requires is_date format is not affecting the db.table.insert, is it?