From: Christopher S. <csi...@gm...> - 2008-08-19 14:51:21
|
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: http://www.sqlobject.org/SQLObject.html#overriding-column-attributes e.g. """ class Foo(SQLObject): lastModified = sqlobject.DateTimeCol() number = sqlobject.IntCol() def _set_number(self, value): self.lastModified = datetime.datetime.now() self._SO_set_number(value) """ cs |