Skip to content

Commit 19e0f68

Browse files
author
Richard Jones
committed
real (non-string, duh) sorting of lists by node id
1 parent 466479f commit 19e0f68

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

roundup/htmltemplate.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: htmltemplate.py,v 1.70 2002-01-23 05:47:57 richard Exp $
18+
# $Id: htmltemplate.py,v 1.71 2002-01-23 06:15:24 richard Exp $
1919

2020
__doc__ = """
2121
Template engine.
@@ -456,12 +456,15 @@ def do_list(self, property, reverse=0):
456456
return _('[List: not a Multilink]')
457457

458458
value = self.determine_value(property)
459-
if not value:
460-
return ''
459+
if not value:
460+
return ''
461461

462+
# sort, possibly revers and then re-stringify
463+
value = map(int, value)
462464
value.sort()
463465
if reverse:
464466
value.reverse()
467+
value = map(str, value)
465468

466469
# render the sub-index into a string
467470
fp = StringIO.StringIO()
@@ -1040,6 +1043,9 @@ def render(self, form):
10401043

10411044
#
10421045
# $Log: not supported by cvs2svn $
1046+
# Revision 1.70 2002/01/23 05:47:57 richard
1047+
# more HTML template cleanup and unit tests
1048+
#
10431049
# Revision 1.69 2002/01/23 05:10:27 richard
10441050
# More HTML template cleanup and unit tests.
10451051
# - download() now implemented correctly, replacing link(is_download=1) [fixed in the

0 commit comments

Comments
 (0)