Bugs item #3370094, was opened at 2011-07-18 14:01
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3370094&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
>Resolution: Works For Me
Priority: 5
Private: No
Submitted By: mexicanferret (mferret)
>Assigned to: Oleg Broytman (phd)
Summary: reslicing SelectResults object leads to error
Initial Comment:
reslicing SelectResults object sometimes leads to error
Ex:
my_selection[0:10][0:20] will result in a "slice object is unsuscriptable" error
This is because of a typo in the sresults.py file line 156.
[code]if self.ops.get('end', None) is not None and value['end'] < end:[/code]
should be replaced by
[code]if self.ops.get('end', None) is not None and self.ops['end'] < end:[/code]
value is a slice object and is indeed unsuscriptable.
I attach the corrected file.
----------------------------------------------------------------------
>Comment By: Oleg Broytman (phd)
Date: 2011-07-18 22:05
Message:
I cannot reproduce the problem. This program works:
class Test(SQLObject):
test = StringCol()
Test.createTable()
Test(test='1')
Test(test='2')
Test(test='3')
Test(test='4')
Test(test='5')
print list(Test.select()[0:3][0:5])
It prints
[<Test 1 test='1'>, <Test 2 test='2'>, <Test 3 test='3'>]
Looks good, right? I use SQLObject 1.1. What version do you have problems
with?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3370094&group_id=74338
|