From 1e0d4c6dfaf44fe897e1f61aaa4a19e86a820250 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 20 Jul 2012 16:32:53 -0500 Subject: [PATCH] fixed a problem with db().select().sort() did not follow book specs --- VERSION | 2 +- gluon/dal.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 555c039d..4994cbd7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-20 13:51:22) dev +Version 2.00.0 (2012-07-20 16:32:48) dev diff --git a/gluon/dal.py b/gluon/dal.py index c7322082..42d357e1 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -1800,6 +1800,7 @@ class BaseAdapter(ConnectionPool): query = query & newquery return query + ################################################################################### # List of all the available adapters; they all extend BaseAdapter. ################################################################################### @@ -8593,7 +8594,10 @@ class Rows(object): """ returns a list of sorted elements (not sorted in place) """ - return Rows(self.db,sorted(self,key=f,reverse=reverse),self.colnames) + rows = Rows(self.db,[],self.colnames,compact=False) + rows.records = sorted(self,key=f,reverse=reverse) + return rows + def group_by_value(self, field): """