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.
Thanks
On Tue, Aug 19, 2008 at 7:51 AM, Christopher Singley <[EMAIL PROTECTED]>wrote:
> 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)
> """
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss