From: Randall Smith <randall@tn...> - 2005-09-24 22:29:44
When creating a new SQLObject instance, I'd like to use the value of one
field as the default for another. Example:
col1 = ForeignKey('AnotherClass')
col2 = StringCol()
def _set_col2(self, input):
if input is None:
a = A(col1=AnotherClassInstance)
I'm concerned that col1 may not always be set first since col2 depends
on col1 being set. Is there a better way to do this?
On Sat, Sep 24, 2005 at 05:26:11PM -0500, Randall Smith wrote:
> I'm concerned that col1 may not always be set first since col2 depends
> on col1 being set. Is there a better way to do this?
Override __init__() or _create() methods and check all columns at once.
Oleg Broytmann http://phd.pp.ru/ phd@...
Programmers don't die, they just GOSUB without RETURN.
Get latest updates about Open Source Projects, Conferences and News.