Mercurial > p > roundup > code
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 2882:cd183bcc4aa4 | 2883:1ca5ebe9b16a |
|---|---|
| 1646 ''' | 1646 ''' |
| 1647 #print 'Multi.getitem', (self, num) | 1647 #print 'Multi.getitem', (self, num) |
| 1648 value = self._value[num] | 1648 value = self._value[num] |
| 1649 return HTMLItem(self._client, self._prop.classname, value) | 1649 return HTMLItem(self._client, self._prop.classname, value) |
| 1650 | 1650 |
| 1651 def sorted(self, property): | |
| 1652 ''' Return this multilink sorted by the given property ''' | |
| 1653 value = list(self._value[num]) | |
| 1654 value.sort(lambda a,b:cmp(a[property], b[property])) | |
| 1655 return value | |
| 1656 | |
| 1651 def __contains__(self, value): | 1657 def __contains__(self, value): |
| 1652 ''' Support the "in" operator. We have to make sure the passed-in | 1658 ''' Support the "in" operator. We have to make sure the passed-in |
| 1653 value is a string first, not a HTMLProperty. | 1659 value is a string first, not a HTMLProperty. |
| 1654 ''' | 1660 ''' |
| 1655 return str(value) in self._value | 1661 return str(value) in self._value |
