Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 2883:1ca5ebe9b16a
*** empty log message ***
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 07 Nov 2004 21:43:50 +0000 |
| parents | ab9ae5cc921b |
| children | 6d6fdd1daf92 |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Sat Nov 06 15:06:59 2004 +0000 +++ b/roundup/cgi/templating.py Sun Nov 07 21:43:50 2004 +0000 @@ -1648,6 +1648,12 @@ value = self._value[num] return HTMLItem(self._client, self._prop.classname, value) + def sorted(self, property): + ''' Return this multilink sorted by the given property ''' + value = list(self._value[num]) + value.sort(lambda a,b:cmp(a[property], b[property])) + return value + def __contains__(self, value): ''' Support the "in" operator. We have to make sure the passed-in value is a string first, not a HTMLProperty.
