let's say you have 150 rows in a db, and you want to grab the last 50 descending, and then reverse them, it would make sense to do something like:
reversed(q.desc_pk())
But that won't give you the last 50 rows in ascending order, it will actually give you the first 50 rows in ascending order because reversed triggers the Iterator.reverse() method, which currently does this:
def reverse(self):
for f in self.query.fields_sort:
f.direction = -f.direction
self.reset()
I'm thinking that's not what we want it to do? It definitely violates the principal of least surprise.
let's say you have 150 rows in a db, and you want to grab the last 50 descending, and then reverse them, it would make sense to do something like:
But that won't give you the last 50 rows in ascending order, it will actually give you the first 50 rows in ascending order because
reversed
triggers theIterator.reverse()
method, which currently does this:I'm thinking that's not what we want it to do? It definitely violates the principal of least surprise.