Re: PyDO2, deleteSome() is broken?

Jacob Smullyan <[email protected]> Sun, 29 May 2005 18:56:29 -0400
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
On Mon, May 30, 2005 at 08:32:02AM +1000, Steve Kieu wrote:
> whenever I call deleteSome it throw errors

Oy, yes, it does, due to a stupid mistake (I forgot to join the list
of sql strings).  Thanks much for pointing it out.  

A fix is checked in subversion.  There are some interesting changes
there since the last release; I was going to wait for a few other
things I had planned before cutting a release, but this bug is bad
enough to make me want to get one out quickly.  Perhaps later tonight.

This points to another problem -- I don't have enough or the right
tests.  It is hard to test much of PyDO without using a driver, but
then it isn't clear how much a test result depends on the driver.
Since I didn't have a brilliant idea of how to solve this, I've
allowed myself to be lazy and not provide good enough test coverage.
Anyone with clever, or, even better, simple, ideas about how to
organize tests for PyDO should shout them out!

Cheers,

js




> 
>  File "//ppcshop/test.html", line 22, in ?
>     temp.deleteSome(EQ(FIELD('name'),'hu'))
>   File
> "/usr/lib/python2.4/site-packages/PyDO2/base.py", line
> 543, in deleteSome
>     return conn.execute(query, values)
>   File
> "/usr/lib/python2.4/site-packages/PyDO2/dbi.py", line
> 112, in execute
>     c.execute(sql, values)
>   File
> "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py",
> line 132, in execute
>     self.errorhandler(self, TypeError, m)
>   File
> "/usr/lib/python2.4/site-packages/MySQLdb/connections.py",
> line 33, in defaulterrorhandler
>     raise errorclass, errorvalue
> TypeError: unsupported operand type(s) for %: 'list'
> and 'tuple'
> ----------------------------------------
> Tag traceback (most recent tag last):
>   File "//ppcshop/test.html", line 4
>     <:call
> "`temp.deleteSome(EQ(FIELD('name'),'hu'))`":>
> 
> However if I call delete() from an instance it works
> fine. so have to do like:
> 
> tmp=temp.getSome(EQ(FIELD('name'),'hu'))
> for i in tmp: i.delete()
> 
> I guess the second approach is less optimal.
> 
> Regards,
> 
> 
> S.KIEU
> 
> Find local movie times and trailers on Yahoo! Movies.
> http://au.movies.yahoo.com
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
> _______________________________________________
> Skunkweb-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/skunkweb-list
> 

-- 
Jacob Smullyan
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCmkiduqamFyFXXLIRAs9oAKC3Cckl2cI0e33tXm77TOIpkGU5mACgiy2K
gGQtBMKdtP1kPsMk8PB1JpI=
=iD7T
-----END PGP SIGNATURE-----