nope, oracle stores DATE. differencing itself from other backends, it's 
your client that translates that date to a string representation. and pydal 
does (or it should) too.

That's what, 
theoretically, 
https://github.com/web2py/pydal/blob/master/pydal/adapters/oracle.py#L28 
and following do: "whenever you transmit a date back to me, please do in 
the following format". it then parses that string to a python date object, 
that is then serialized by python TO the format specified in the 
requires=IS_DATE() bit.

When you insert, it's the same process reversed: a form is ingested, the 
string is parsed to a datetime python object according to the 
requires=IS_DATE() format, the python date object is expanded to the format 
that session of oracle expects, and it is stored as DATE.

On Wednesday, July 20, 2016 at 5:44:17 PM UTC+2, web2py...@gmail.com wrote:
>
> I'm not sure what you mean... Oracle stores the date type using "/" 
> instead of "-" or ".".. i looked into the code for the parsing that web2py 
> uses and it only parses with "+" "-" or "." so that is why i think my issue 
> is arising. I was wondering if anyone knows an intermediary step i can take 
> to avoid this issue or maybe a style change i can make...
>
> On Wednesday, July 20, 2016 at 11:35:31 AM UTC-4, Niphlod wrote:
>>
>> are the actual fields in the oracle backend a "DATE" field ? if so, pydal 
>> NEEDS to parse it correctly, no matter the format you want to display it.
>>
>> On Wednesday, July 20, 2016 at 5:06:06 PM UTC+2, web2py...@gmail.com 
>> wrote:
>>>
>>> What i've found is that the oracle has the date stored at 2016/04/12 and 
>>> when the parse occurs, it looks for a - to seperate and cant find it. This 
>>> is why it states that its not an integer because the "/" are included in 
>>> the term... is there a way to parse with "/" instead of "-"? i know SQL 
>>> stores date in the YYYY-MM-DD format so thats why its not an issue there, 
>>> but im not quite sure what to do with oracle and setting the field to 
>>> "date".
>>>
>>> On Tuesday, July 19, 2016 at 3:54:10 PM UTC-4, web2py...@gmail.com 
>>> wrote:
>>>>
>>>> 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to