Code

*cough* sort list results *cough*
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Mon, 16 Sep 2002 06:51:13 +0000 (06:51 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Mon, 16 Sep 2002 06:51:13 +0000 (06:51 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1179 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/cgi/templating.py

index a42ae90d2ff1d26c9f98221a07546ae63c3f3407..2561b2ba0d9274da95b3fcd63669178aa9907cca 100644 (file)
@@ -323,7 +323,13 @@ class HTMLClass(HTMLPermissions):
             klass = HTMLUser
         else:
             klass = HTMLItem
-        l = [klass(self._client, self.classname, x) for x in self._klass.list()]
+
+        # get the list and sort it nicely
+        l = self._klass.list()
+        sortfunc = make_sort_function(self._db, self._prop.classname)
+        l.sort(sortfunc)
+
+        l = [klass(self._client, self.classname, x) for x in l]
         return l
 
     def csv(self):