A belated thank you to Oleg and Christopher...but it seems like neither of
these suggestions really are universal enough.
Oleg's suggestion to override set is good, but I don't want to lose the
ability to assign directly to columns.
Christopher's suggestion is also good, but I have too many columns to
override the column attributes for each of them.
I read through some of the source and found RowUpdateSignal. It seems like
the best thing will be to catch this, and then just set any column called
m_time with the current time.
As soon as I have some time I'll try it, and I'll report back. In the
meantime if anyone knows why this is the wrong track or has a suggestion,
please let me know.
On Tue, Aug 19, 2008 at 7:51 AM, Christopher Singley <csingley@...:
> On Tuesday 19 August 2008 04:08:13 Oleg Broytmann wrote:
> > On Mon, Aug 18, 2008 at 05:55:28PM -0700, Sam's Lists wrote:
> > > 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.)
> > For record modification override .set() method and modify your program
> > to always call .set(); never modify a single attribute via assignment.
> You could also try overriding column attributes:
> class Foo(SQLObject):
> lastModified = sqlobject.DateTimeCol()
> number = sqlobject.IntCol()
> def _set_number(self, value):
> self.lastModified = datetime.datetime.now()