nope... don't go the wrong way. web2py/pydal stores dates and datetimes to
native types, with the correct format in the database.
Upon insertion and retrieval, it uses the format to translate the native
type to the string representation the app wants.
tl;dr : format is just for representation, not for storage. If it works
with postgresql or sqlite, it NEEDS to work with oracle, too.
On Wednesday, July 20, 2016 at 3:54:19 PM UTC+2, Marlysson Silva wrote:
>
> Try something how:
>
> ......... IS_DATE(format('%Y-%M-%D) .
>
>
> Seeing source code web2py, the split is made at "-" .. maybe this be the
> error.
>
>
> Em terça-feira, 19 de julho de 2016 16:54:10 UTC-3, [email protected]
> escreveu:
>>
>> Hi everyone,
>>
>> i keep getting this error:
>>
>> File "/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1544, in
>> parse_date
>> (y, m, d) = map(int, str(value)[:10].strip().split('-'))
>> ValueError: invalid literal for int() with base 10: '2016/04/12'
>>
>>
>> im basically submitting the form and searching a database for information
>> between certain dates using DAL with a table. the table/date format is
>> summarized as follows:
>>
>> import datetime
>>
>> today = datetime.datetime.today()
>>
>> yesterday = today.date() - datetime.timedelta(days=1)
>>
>> db = DAL(oracle:...........)
>>
>> db.table('name', Field('startdt' , type = 'date' , default = yesterday,
>> requires IS_DATE(format('%Y/%M/%D))),
>>
>> Field('enddt', type = 'date' , default = today,
>> requires IS_DATE(format('%Y/%M/%D))),
>>
>> ......)
>>
>>
>> Im thinking it doesn't like the database has the format but not 100%.
>>
>>
>> thank you
>>
>>
>>
>>
>>
>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.