From: Oleg B. <ph...@ph...> - 2005-09-10 18:47:31
|
On Sat, Sep 10, 2005 at 09:29:17AM +0200, Andreas Kostyrka wrote: > Am Freitag, den 09.09.2005, 17:05 +0400 schrieb Oleg Broytmann: > > On Fri, Sep 09, 2005 at 02:53:05PM +0200, Andreas Kostyrka wrote: > > > class Worktime(SQLObject): > > > customer = ForeignKey("customer", default=WHATDOIPUTHERE) > > > task = ForeignKey("task") > > > > > Now, a _set_customer setter doesn't work, because it needs the > > > corresponding .task value > > > > And what? > Well, somehow a default value derived from another column would make > much sense. Not only in this case but others too. 1. I still do not understand why your _set_customer doesn't work, and what the .tash has to do with it. 2. Can you explain your wish in terms of SQL? Can you write a CREATE TABLE clause declaring a default value for a column that depends on another column? > > > and it seems that _set_customer doesn't get > > > called by Worktime(...) > > > > It must get called. What version of SQLObject? > probably r915. Fresh enough. Are you sure _set_customer doesn't get called? Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |