# HG changeset patch # User casties # Date 1360352425 -3600 # Node ID 5f3d6623b71e24851d112d6573ade43bc1f125ab # Parent 0e87d5d80709f1cf6474f57f5f0cd3b4c2c08869 fixed bug when params to ZDBInlineSearch are not strings. new method ZDBSlice. diff -r 0e87d5d80709 -r 5f3d6623b71e DBInterface.py --- a/DBInterface.py Fri Jan 11 19:14:07 2013 +0100 +++ b/DBInterface.py Fri Feb 08 20:40:25 2013 +0100 @@ -20,6 +20,9 @@ if s is None: return "" + if not isinstance(s, basestring): + s = str(s) + # remove ' s = s.replace("'","") # all else -> "_" @@ -92,6 +95,15 @@ return Results(res) + def ZDBSlice(self, results, size=0, offset=0): + """return a (subset-) list of rows from results. + ZRDB.Results doesn't do list-slicing.""" + res = [x for x in results] + if size > 0: + return res[offset:(offset+size)] + else: + return res[offset:] + # # Old way using cursor from DA # diff -r 0e87d5d80709 -r 5f3d6623b71e version.txt --- a/version.txt Fri Jan 11 19:14:07 2013 +0100 +++ b/version.txt Fri Feb 08 20:40:25 2013 +0100 @@ -1,1 +1,1 @@ -1.7 \ No newline at end of file +1.8 \ No newline at end of file