From the sqlobject mailing (thanks to Andrew Bennetts):
from sqlobject.sqlbuilder import SQLConstant
UTC_NOW = SQLConstant("CURRENT_TIMESTAMP AT TIME ZONE 'UTC'")
DEFAULT = SQLConstant("DEFAULT")If you use lazyUpdates then you will need to explicitly sync an object
before reading its column back after assigning a constant to it. Example of
what I mean:
# Assume Foo is an SQLObject with a DateTimeCol called lastupdated
foo = Foo.get(1)
foo.lastupdated = UTC_NOW
print foo.lastupdated # prints UTC_NOW object
foo.sync()
print foo.lastupdated # prints an actual datetime, as stored in the db.
Aside from that, it works quite smoothly.
Popularity: 18%