Skip to content

Commit d449ab4

Browse files
author
Richard Jones
committed
sort HTMLClass.properties results by name (feature [SF#724738])
1 parent f134d5d commit d449ab4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Feature:
6868
Note: requires python 2.2+
6969
- added Windows Service mode for roundup-server when daemonification is
7070
attempted on Windows.
71+
- sort HTMLClass.properties results by name (sf feature 724738)
7172

7273
Fixed:
7374
- applied unicode patch. All data is stored in utf-8. Incoming messages

roundup/cgi/templating.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def getItem(self, itemid, num_re=re.compile('\d+')):
338338

339339
return klass(self._client, self.classname, itemid)
340340

341-
def properties(self):
341+
def properties(self, sort=1):
342342
''' Return HTMLProperty for all of this class' properties.
343343
'''
344344
l = []
@@ -351,6 +351,8 @@ def properties(self):
351351
if isinstance(prop, klass):
352352
l.append(htmlklass(self._client, self._classname, '',
353353
prop, name, value, self._anonymous))
354+
if sort:
355+
l.sort(lambda a,b:cmp(a._name, b._name))
354356
return l
355357

356358
def list(self):

0 commit comments

Comments
 (0)