[SQLObject] How to reset to the default value?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Soni B. <be...@ai...> - 2006-04-29 13:40:52
|
Hello folks,
lets assume we have a class like:
class Date(SQLObject):
timestamp = DateTimeCol(default = SQLConstant("CURRENT_TIMESTAMP AT
TIME ZONE 'UTC'"))
comment = StringCol(default = 'no comment')
Now at some point i want to reapply the default value of comment or
timestamp.
I could easily do:
my_date.timestamp = SQLConstant("CURRENT_TIMESTAMP AT TIME ZONE 'UTC'")
or
my_date.timestamp = 'no comment'
But this is not quiet what i want (just imagine that i change to
'comentless' in the future)
I'm looking for an SQLObject equivalent of SQL's DEFAULT. Is there a way
to achieve this currently? If not, will it be hard to implement?
Cheers,
--
Soni Bergraj
|