Commit c277ff7c authored by Martijn Pieters's avatar Martijn Pieters

Fix ZTUtils tree makers:

- SimpleTree could not build a tree from anything but the ZODB root object,
  because the REQUEST object could no longer be acquired once a tree root object
  was wrapped inside a tree node class.

- TreeMaker.setChildAccess(filter=...) didn't work because the acquisition
  filter used was using too many arguments.
parent 09c54abf
......@@ -12,8 +12,8 @@
##############################################################################
__doc__='''Simple Tree classes
$Id: SimpleTree.py,v 1.3 2002/08/14 22:10:12 mj Exp $'''
__version__='$Revision: 1.3 $'[11:-2]
$Id: SimpleTree.py,v 1.4 2002/10/03 21:08:40 mj Exp $'''
__version__='$Revision: 1.4 $'[11:-2]
from Tree import TreeMaker, TreeNode, b2a
......@@ -52,6 +52,9 @@ class SimpleTreeMaker(TreeMaker):
node.id = b2a(self.getId(object))
return node
def markRoot(self, node):
node.tree_pre = self.tree_pre
node.baseURL = node.object.REQUEST['BASEPATH1']
def tree(self, root, expanded=None, subtree=0):
node = TreeMaker.tree(self, root, expanded, subtree)
if not subtree:
node.tree_pre = self.tree_pre
node.baseURL = root.REQUEST['BASEPATH1']
return node
......@@ -12,8 +12,8 @@
##############################################################################
__doc__='''Tree manipulation classes
$Id: Tree.py,v 1.6 2002/08/14 22:10:12 mj Exp $'''
__version__='$Revision: 1.6 $'[11:-2]
$Id: Tree.py,v 1.7 2002/10/03 21:08:40 mj Exp $'''
__version__='$Revision: 1.7 $'[11:-2]
from Acquisition import Explicit
from ComputedAttribute import ComputedAttribute
......@@ -106,8 +106,6 @@ class TreeMaker:
node.state = -1 # collapsed
if not subtree:
node.depth = 0
if hasattr(self, 'markRoot'):
self.markRoot(node)
return node
def node(self, object):
......@@ -143,8 +141,8 @@ def simple_type(ob,
type(0L):1, type(None):1 }.has_key):
return is_simple(type(ob))
def aqcallback(self, inst, parent, name, value, filter):
return filter(self, inst, parent, name, value)
def aqcallback(self, inst, name, value, filter):
return filter(self, inst, name, value)
from binascii import b2a_base64, a2b_base64
from string import translate, maketrans
......
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