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

WIP: fix sorting

parent b5b8aa10
Branches
No related tags found
No related merge requests found
......@@ -42,10 +42,14 @@ class FindResult(Result):
upper = (skip + limit if skip is not None and limit is not None else
limit)
if sort:
rows.sort(key=lambda x: x[sort[0][0]], reverse=sort[0][1] < 0)
if columns is not None:
if sort:
named_columns = [dict(zip(columns, row)) for row in rows]
named_columns.sort(key=lambda x: x[sort[0][0]], reverse=sort[0][1] < 0)
self._results = named_columns[skip:upper]
else:
self._results = []
for row in rows[skip:upper]:
self._results.append(dict(zip(columns, row)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment