From 97776626afe06ffe20eb1449199443b79c74cbe5 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 9 May 2003 02:23:33 +0000 Subject: [PATCH] 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 --- CHANGES.txt | 1 + roundup/cgi/templating.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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): -- 2.30.2