Hi everybody! I have a dtml-in loop which iterates over a dictionary : <dtml-in collectionOfStr1s sort=title> <dtml-var "collectionOfStr1s[_['sequence-index']]['title']"> <dtml-var "collectionOfStr1s[_['sequence-index']][''ancestor']"> </dtml-in> The "collectionOfStr1s" dictionary was previously fed with successive dtml-calls : <dtml-call "collectionOfStr1s.append({''ancestor':ancestor, 'title':title})"> etc. Everything works fine except that the result of the dtml-in loop is always unsorted (at least certainly not by title : it just spits out the dictionary entries in the order in which they were entered. I have a feeling I am missing something stupid but essential... Could you help me? Pierre Godefroy
On Sat, Jun 15, 2002 at 03:46:33PM +0200, Pierre Godefroy wrote:
I have a dtml-in loop which iterates over a dictionary :
<dtml-in collectionOfStr1s sort=title>
If you are iterating over a dictionary this must be <dtml-in collectionOfStr1s mapping sort=title> i.e. you are to indicate collectionOfStr1s is a dictionary (mapping). Oleg. -- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
participants (2)
-
Oleg Broytmann -
Pierre Godefroy