You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to mongoDB and still having some problems with a TIME field. When I set a TIME field in the table, fill the input field of a sqlform (only time is allowed) and send the data to table, all the record is inserted without any warning. But when I try to show in the sqlform, I receive a message:
Traceback (most recent call last):
File "/home/xxx.../applications/ras/controllers/appadmin.py", line 269, in select
*fields, limitby=(start, stop))
File "/home/xxx.../gluon/packages/dal/pydal/objects.py", line 2026, in select
return adapter.select(self.query,fields,attributes)
File "/home/xxx.../gluon/packages/dal/pydal/adapters/mongo.py", line 353, in select
result = processor(rows, fields, newnames, False)
File "/home/xxx.../gluon/packages/dal/pydal/adapters/base.py", line 1596, in parse
value = self.parse_value(value,ft,blob_decode)
File "/home/xxx.../gluon/packages/dal/pydal/adapters/base.py", line 1450, in parse_value
return self.parsemap[key](value,field_type)
File "/home/xxx.../gluon/packages/dal/pydal/adapters/base.py", line 1472, in parse_time
time_items = map(int,str(value)[:8].strip().split(':')[:3])
ValueError: invalid literal for int() with base 10: '2000-01-'
Web2py 2.10.4.
Trying to understand what happened, I'm googled for some info, and found the Mongo adapter code (yes, I didn't tried in my own computer).
Reading the code (in pydal/adapters/mongo.py), I see a (possible) clue: The lines 148 to 163 is, in some way, weird for my reading. Maybe I misunderstood some point, but this
t = datetime.time(0,0,0)
is a formatter for a field type DATE, and this
t = datetime.date(2000,1,1)
is a formatter for a field type TIME ?
My second bet is that the parser of time (the time_itens above) need to be modified to work with time in mongo.
Best regards, and keep going the invaluable work with this lib.
The text was updated successfully, but these errors were encountered:
Hi,
I'm new to mongoDB and still having some problems with a TIME field. When I set a TIME field in the table, fill the input field of a sqlform (only time is allowed) and send the data to table, all the record is inserted without any warning. But when I try to show in the sqlform, I receive a message:
Web2py 2.10.4.
Trying to understand what happened, I'm googled for some info, and found the Mongo adapter code (yes, I didn't tried in my own computer).
Reading the code (in pydal/adapters/mongo.py), I see a (possible) clue: The lines 148 to 163 is, in some way, weird for my reading. Maybe I misunderstood some point, but this
is a formatter for a field type DATE, and this
is a formatter for a field type TIME ?
My second bet is that the parser of time (the time_itens above) need to be modified to work with time in mongo.
Best regards, and keep going the invaluable work with this lib.
The text was updated successfully, but these errors were encountered: