I finally found what the problem is.
I have defined the table as
db.Field('starts', 'time', requires=IS_TIME()),
db.Field('ends', 'time', requires=IS_TIME()))
and when a user fills the form I have as defaults starts = 0:00:00 and ends =
24:00:00
the ends value is the problem.
The last row in the error:
ValueError: invalid literal for int() with base 10: '1 day, 0'
if I put ends = 28:00:00 error message is:
ValueError:invalid literalforint()with base10:'1 day, 4'
so when extracing the value 24:00:00 from time column it gets converted to '1
day' instead of 24:00:00.
Is this a bug or correct behavior?
I would like to use values 0:00:00 and 24:00:00 to mark a whole day.
Kenneth
This is still an option:
On Aug 9, 7:45 am, mdipierro<[email protected]> wrote:
You have the problem described here:
http://web2py.com/book/default/chapter/06#Fixing-Broken-Migrations
The first one of them.
On Aug 9, 6:31 am, Kenneth<[email protected]> wrote:
I don´t understand what am I doing wrong.
command:
days = db((db.troop_place_day.day ==
2)&(db.troop_place_day.troop_place == 21)).select()
gives this error:
Traceback (most recent call last):
File "gluon/restricted.py", line 178, in restricted
exec ccode in environment
File "/data/domains/exp-kal.nudata.fi/applications/init/controllers/
troop.py", line 2195, in<module>
File "gluon/globals.py", line 96, in<lambda>
self._caller = lambda f: f()
File "gluon/tools.py", line 2219, in f
return action(*a, **b)
File "/data/domains/exp-kal.nudata.fi/applications/init/controllers/
troop.py", line 985, in edit_saleplace
days = db((db.troop_place_day.day ==
2)&(db.troop_place_day.troop_place == 21)).select()
File "gluon/sql.py", line 3162, in select
return self.parse(db,rows,self.colnames,SetClass=Set)
File "gluon/sql.py", line 3231, in parse
str(value)[:8].strip().split(':')[:3]]
ValueError: invalid literal for int() with base 10: '1 day, 0'
My model for that table looks like this:
db.define_table('troop_place_day',
db.Field('troop_place', db.troop_place, required=True),
db.Field('day', 'integer'),
db.Field('starts', 'time', requires=IS_TIME()),
db.Field('ends', 'time', requires=IS_TIME()))
This error just started coming maybe an hour ago. I just deleted all
records from the record and same thing continues.
I really don't understand what is happening.
Kenneth