I have a custom form with a date ('data_prev') field, when I try to
view the table from appadmin after a date insert I get:
Traceback (most recent call last):
File "C:\Python25\web2py\gluon\restricted.py", line 62, in
restricted
exec ccode in environment
File "C:\Python25\web2py\applications\digitalcosts/controllers/
appadmin.py", line 162, in <module>
File "C:\Python25\web2py\gluon\globals.py", line 55, in <lambda>
self._caller=lambda f: f()
File "C:\Python25\web2py\applications\digitalcosts/controllers/
appadmin.py", line 130, in select
records=SQLTABLE(records,linkto,upload,_class='sortable'))
File "C:\Python25\web2py\gluon\sqlhtml.py", line 259, in __init__
for rc,record in enumerate(sqlrows):
File "C:\Python25\web2py\gluon\sql.py", line 1200, in __iter__
yield self[i]
File "C:\Python25\web2py\gluon\sql.py", line 1171, in __getitem__
row[tablename][fieldname]=datetime.date(y,m,d)
ValueError: day is out of range for month
In the model I have:
import datetime
now=datetime.date.today()
..
..SQLField('data_prev','date',default=now)...
..
db2.mytable.data_prev.requires=IS_DATE(T('%d-%m-%Y')
What can I do without patching sql.py ?
carlo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---