because you define in db as time, and need to be datetime. I think

On Aug 9, 9:51 am, Kenneth Lundström <kenneth.t.lundst...@gmail.com>
wrote:
> Now I�m getting:
>
> Traceback(most recent call last):
>    File"gluon/restricted.py",line178,inrestricted
>      execccodeinenvironment
>    
> File"/data/domains/exp-kal.nudata.fi/applications/init/controllers/troop.py " 
>  <https://exp-kal.nudata.fi/admin/default/edit/init/controllers/troop.py>,line2195,in<module>
>    File"gluon/globals.py",line96,in<lambda>
>      self._caller=lambdaf:f()
>    File"gluon/tools.py",line2219,inf
>      returnaction(*a, **b)
>    
> File"/data/domains/exp-kal.nudata.fi/applications/init/controllers/troop.py " 
>  <https://exp-kal.nudata.fi/admin/default/edit/init/controllers/troop.py>,line985,inedit_saleplace
>      days=db((db.troop_place_day.day() 
> ==2)&(db.troop_place_day.troop_place==21)).select()
> TypeError:'Field'objectis notcallable
>
> But why should I use day(), is day a reserved word, should I use
> something else instead.
>
> Kenneth
>
>
>
> > change with: db.troop_place_day.day()==2 if I not wrong
>
> > On Aug 9, 8:31 am, Kenneth<kenneth.t.lundst...@gmail.com>  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

Reply via email to