PyDO 2.0b2 OneToMany with raw sql broken ? Partial fix.

Jonan Santiago <[email protected]> Thu, 10 Nov 2005 17:36:10 -0500
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
Hello,
   When passing a string for raw sql where statements to OneToMany
attributes the function fails. Bugs are in the subfunction getMany().

First some naming errors on line 929-930 which should be:

conn=self.getDBI()
converter=conn.getConverter()

After fixing these the function/query fails with:

TypeError: not all arguments converted during string formatting

There is an extra bind value in 'extravalue' the result of
the second _processWhere() on line 932. So the foreignkey bind value
is repeated twice. I fixed this by resetting the converter after
the first _processWhere(). 

 Not sure this fix is correct since I don't understand
everything going on with 'converter' and _processWhere() .

Thanks
-- 
-Jonan Santiago


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php