Re: [web2py] Re: Datetime Issue error

2013-09-17 Thread Niphlod
yep, every now and then I strip ctrl, c and v directly from the keyboard :P On Tuesday, September 17, 2013 12:39:03 PM UTC+2, Ramos wrote: > > hell with copy paste. > I had a date field and changed to datetime but forgot to change the > validator. > > Thank you a lot Niphold > > > > > > > 2013/9/

Re: [web2py] Re: Datetime Issue error

2013-09-17 Thread António Ramos
hell with copy paste. I had a date field and changed to datetime but forgot to change the validator. Thank you a lot Niphold 2013/9/17 Niphlod > first and foremost if you need a datetime you should use the > IS_DATETIME validator :-P > Second, either you pass a FIXED format (not depen

Re: [web2py] Re: Datetime Issue error

2013-09-17 Thread Niphlod
first and foremost if you need a datetime you should use the IS_DATETIME validator :-P Second, either you pass a FIXED format (not dependant on T) or you act on the "default" %Y-%m-%d translation string (from the languages section in the admin app). It's then easier to track "bugs" on the l

Re: [web2py] Re: Datetime Issue error

2013-09-17 Thread António Ramos
If i code db.define_table('test11', Field('nome'), Field('datt','datetime')) db.test11.datt.requires=[IS_DATE(format=T('%Y/%m/%d %H:%M:%S'), error_message=T("Formato pretendido /mm/dd"))] It saves the record with 2012/01/01 00:00:00 in the datt field clearing my time selection in the

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread António Ramos
sorry the copy paste i have this output In [18]: IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:MM:SS"))("2013/09-25 09:54:24") Out[18]: ('2013/09-25 09:54:24', 'Formato pretendido /mm/dd HH:MM:SS') and this In [8] : IS_DATE(format=T('%Y/%m/%d %H:%M:

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread António Ramos
i have this output in[3]: IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:MM:SS"))("2013/09/25 09:54:24") Out[17]: (datetime.date(2013, 9, 25), None) In [4] : IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:MM:SS"))("20

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread Niphlod
this is a known issue of sqlite: you can't change the type and expect everything to work out http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Gotchas On Wednesday, September 11, 2013 1:08:46 PM UTC+2, Ramos wrote: > > The field was only date and i changed it to dateti

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread Federico Ferraro
Test it and validator not error : IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:MM:SS"))("2013/09/25 09:54:24") Out[17]: (datetime.date(2013, 9, 25), None) In [18]: IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread António Ramos
The field was only date and i changed it to datetime afer realised i needed the time 2013/9/11 Niphlod > data will always be stored in ISO format. SQLite in addition stores > datetimes as strings 'cause there's no datetime native field. > Did you change the field after creating it ? Does this

[web2py] Re: Datetime Issue error

2013-09-11 Thread Niphlod
data will always be stored in ISO format. SQLite in addition stores datetimes as strings 'cause there's no datetime native field. Did you change the field after creating it ? Does this error happen also on a clean database ? On Wednesday, September 11, 2013 10:58:56 AM UTC+2, Ramos wrote: > > m