What do you mean? The field ReqTime is defined as a string:
>>> db4.data_table[78978]
<Row {'MacAddr': '00000000000000D1', 'update_record': <function <lambda> at
0x101cc9a28>, 'Vi': 34.88671875, 'StringID': 'S00000003', 'Vstring': 24.0,
'Vo': 36.41015625, 'Ii': 1.61328125, 'Io': 1.4921875, 'RollupId': None, 'Po':
54.330780029296903, 'ResTime': '2010-11-08T22:09:00.382999897', 'Pi':
56.282089233398402, 'ReqTime': '2010-11-08T22:09:00.282999992', 'id': 78978,
'delete_record': <function <lambda> at 0x101cc9b90>, 'FreezeTime': None}>
>>> type(row.ReqTime)
<type 'str'>
On Nov 20, 2010, at 13:36 , CesarBustios wrote:
> 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:[email protected]>
>> 512/203.3198 (m)
--
Lorin Rivers
Mosasaur: Killer Technical Marketing <http://www.mosasaur.com>
<mailto:[email protected]>
512/203.3198 (m)