Hi!

On Sat, Oct 25, 2014 at 11:52:37AM -0600, Andrew Trusty <atru...@gatech.edu> 
wrote:
> Hi,
> 
> I recently discovered that some of my code was passing unicode strings to
> orderBy and that this worked as long as the strings didn't start with "-".
> When they did start with "-", the _mungeOrderBy check (line 69 in
> sresults.py) didn't detect the "-" because the strings were of type unicode
> and not type str and _mungeOrderBy checks for str and not basestring.
> 
> I was just wondering if this was on purpose or not as it looks like there
> are other places in the sqlobject code that do check for type basestring.

   Certainly not. Just an oversight. If you replace 'str' with
'basestring' in 'if isinstance(orderBy, str)' does it work for you?

> Andrew

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            p...@phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to