Commit 2e1f1428 authored by Christopher Petrilli's avatar Christopher Petrilli

Fixed tree tag so that reverse option doesn't modify inplace the

database.
parent c430a264
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
"""Rendering object hierarchies as Trees """Rendering object hierarchies as Trees
""" """
__rcs_id__='$Id: TreeTag.py,v 1.33 1999/07/13 14:21:57 jim Exp $' __rcs_id__='$Id: TreeTag.py,v 1.34 1999/08/27 14:55:57 petrilli Exp $'
__version__='$Revision: 1.33 $'[11:-2] __version__='$Revision: 1.34 $'[11:-2]
from DocumentTemplate.DT_Util import * from DocumentTemplate.DT_Util import *
from DocumentTemplate.DT_String import String from DocumentTemplate.DT_String import String
...@@ -155,6 +155,11 @@ class Tree: ...@@ -155,6 +155,11 @@ class Tree:
__call__=render __call__=render
def reverse_items(self, items):
s = list(items)
s.reverse()
return s
String.commands['tree']=Tree String.commands['tree']=Tree
pyid=id # Copy builtin pyid=id # Copy builtin
...@@ -337,7 +342,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -337,7 +342,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
items[i]=items[i][1] items[i]=items[i][1]
if have_arg('reverse'): if have_arg('reverse'):
items.reverse() items=self.reverse_items(items)
diff.append(id) diff.append(id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment