Okay, unless I'm missing something your answer only works for creation
time. I want it to record modification time, which is different then
creation time (except of course at the time of creation, in which case
they'd be the same thing.)
Thanks
Sam
On Sun, Aug 17, 2008 at 4:45 AM, Petr Jakeš <pet...@tp...> wrote:
>
>> I'd like to be able to create a timestamp column called "mtime" in some of
>> my columns. This would hold a timestamp of when the row was last modified.
>>
>> But I'd like the timestamp to be updated automatically whenever sqlobject
>> updates anything else in the row.
>>
>> How can I do this? I'd like a solution that is easy to add to any
>> table....maybe so easy that the table only has to have a column called mtime
>> and then everything happens without anything extra on my part.
>>
>> Thanks
>>
>
> from datetime import datetime
> tStamp = DateTimeCol(default=datetime.now)
>
> HTH
>
> Petr Jakes
>
|