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

-------------------------------------------------------------------------
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

Reply via email to