Re: [SQLObject] ForeignKey setters bug
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2005-09-13 15:43:04
|
On Tue, Sep 13, 2005 at 10:29:05AM -0500, Ian Bicking wrote: > Yeah, I'm still figuring out what the change really means. What exactly > are you proposing to change it to? Simply delete it. The test suite passed. Index: sqlobject/main.py =================================================================== --- sqlobject/main.py (revision 978) +++ sqlobject/main.py (working copy) @@ -1189,13 +1189,13 @@ # If a foreign key is given, we get the ID of the object # and put that in instead - if kw.has_key(column.foreignName): - kw[column.name] = getID(kw[column.foreignName]) - del kw[column.foreignName] # Then we check if the column wasn't passed in, and # if not we try to get the default. - if not kw.has_key(column.name): + if not kw.has_key(column.name) and not kw.has_key(column.foreignName): default = column.default # If we don't get it, it's an error: Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |