Did you try converting the Field to string?

str(db4.data_table.ReqTime).split(".")[0]

Lorin Rivers ha escrito:
> What about using a function? I need run db.table.field through split (the 
> time part has too many decimal places) and then convert from string to time
>
> Here's what I tried:
> db4((db4.data_table.ReqTime >="2010-11-08T22:09:00") & 
> (db4.data_table.ReqTime < "2010-11-08T22:09:10") & (db4.data_table.MacAddr == 
> "00000000000000DF")).update(db4.data_table.FreezeTime=datetime.strptime(db4.data_table.ReqTime.split(".")[0],
>  "%Y-%m-%dT%H:%M:%S"))
>
> and got:
> AttributeError: 'Field' object has no attribute 'split'
>
> On Nov 20, 2010, at 11:40 , mdipierro wrote:
>
> > something like this?
> >
> > db(query).update(field1=db.table.field2+db.table.field3)
> >
> > Massimo
> >
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing <http://www.mosasaur.com>
> <mailto:lriv...@mosasaur.com>
> 512/203.3198 (m)

Reply via email to