I too got the same error with the date field, when I was trying to import
the data from csv. After investigation, it turned out to be problem with
imported data. It was expecting data for date in YYYY-MM-DD format but some
of my data were in YYY-MMM-DD format. After changing the data, things were
fine.

Try checking the data for date in the table. If you still couldnt resolve
it, change the column to string & then do a export to csv, check the csv
data, remove the data from table & re-import it.

Sudhakar.M

2008/12/28 mdipierro <[email protected]>

>
> in web2py_ajax those strings are marked by T so you should be able to
> translate them to.
> there may be problems if IS_DATE is inconsistent with datepicker.
>
> Massimo
>
> On Dec 28, 11:25 am, carlo <[email protected]> wrote:
> > Massimo,
> >
> > could be a datepicker issue?
> >
> > I noticed that if I put SQLField('data_prev','string')... in the model
> > then everything is fine.
> >
> > Who should be in charge of converting the datepicker dates (which are
> > strings) in date objects for sqlite?
> >
> > carlo
> >
> > On 28 Dic, 17:41, mdipierro <[email protected]> wrote:
> >
> > > This should not be happening. It seems the data is incorrect in the
> > > database.
> > > Which database? Which web2py version? Can you send me (confidentially)
> > > your app via email?
> >
> > > Massimo
> >
> > > On Dec 28, 10:24 am, carlo <[email protected]> wrote:
> >
> > > > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to