Code

sort HTMLClass.properties results by name (sf feature 724738)
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Fri, 9 May 2003 02:23:33 +0000 (02:23 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Fri, 9 May 2003 02:23:33 +0000 (02:23 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1699 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
roundup/cgi/templating.py

index 4ee9825722e05cfa9d4d87d71ed91b8a34a7ddda..e67226d68d74bab7b3ca7197719ff2e8341d6063 100644 (file)
@@ -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
index b6cbdcc569242ee3207110aa6c15d3c3c61a2159..cd4a87194f2705904a0b65e21607d3e79a9ccd3c 100644 (file)
@@ -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):