From: richard Date: Fri, 9 May 2003 02:23:33 +0000 (+0000) Subject: sort HTMLClass.properties results by name (sf feature 724738) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=97776626afe06ffe20eb1449199443b79c74cbe5;p=roundup.git sort HTMLClass.properties results by name (sf feature 724738) git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1699 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index 4ee9825..e67226d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -68,6 +68,7 @@ Feature: Note: requires python 2.2+ - added Windows Service mode for roundup-server when daemonification is attempted on Windows. +- sort HTMLClass.properties results by name (sf feature 724738) Fixed: - applied unicode patch. All data is stored in utf-8. Incoming messages diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index b6cbdcc..cd4a871 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -338,7 +338,7 @@ class HTMLClass(HTMLPermissions): return klass(self._client, self.classname, itemid) - def properties(self): + def properties(self, sort=1): ''' Return HTMLProperty for all of this class' properties. ''' l = [] @@ -351,6 +351,8 @@ class HTMLClass(HTMLPermissions): if isinstance(prop, klass): l.append(htmlklass(self._client, self._classname, '', prop, name, value, self._anonymous)) + if sort: + l.sort(lambda a,b:cmp(a._name, b._name)) return l def list(self):