Skip to content
Snippets Groups Projects
Verified Commit b5b8aa10 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Fix sorting

parent df81b88f
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,8 @@ class FindResult(Result): ...@@ -42,6 +42,8 @@ class FindResult(Result):
upper = (skip + limit if skip is not None and limit is not None else upper = (skip + limit if skip is not None and limit is not None else
limit) limit)
if sort:
rows.sort(key=lambda x: x[sort[0][0]], reverse=sort[0][1] < 0)
if columns is not None: if columns is not None:
self._results = [] self._results = []
...@@ -50,8 +52,6 @@ class FindResult(Result): ...@@ -50,8 +52,6 @@ class FindResult(Result):
else: else:
self._results=rows self._results=rows
if sort:
self._results.sort(key=lambda x: x[sort[0][0]], reverse=sort[0][1] < 0)
def __iter__(self): def __iter__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment