[Zope] 2 problems - dtml-tree and python scripting

Sebastian Kors papst@gurkenreich.de
Mon, 2 Sep 2002 23:14:18 +0200


Hello out there,

I have two problems:

The first is about dtml-tree Tag.
With the following code i have the problem that when i click on the last
leaf in the tree, the whole tree closes itself.
[code]
<dtml-tree demo branches_expr="objectValues(['Folder'])" sort="id"
single="1">
<dtml-if "_.SecurityCheckPermission('View', this())">
<img src="<dtml-var icon>" >
<a href="<dtml-var tree-item-url>">
<dtml-var getId></a>
</dtml-if>
</dtml-tree>
[/code]

Result is e.g.
/
|
+--folder1
|
+--folder2
+----subfolder1
+-------subsubfolder1
|
+--folder3

When i click on subsubfolder1, the expanded tree collapses.

How can i have the tree expanded when clicking on the last item?

My second problem is this:

In a python-based script i try to call a external Method in a different
context. The problem is that the place where the method is called is
stored in a variable.

Take this(the given variable is "folder"):

[code]
links=[]
for parent in context.REQUEST.PARENTS[1:]:
    links.insert(0, """%s""" % (parent.getId()))
abs_folder = "/".join(links) + "/" + context.getId()
context.myexternalMethod(abs_folder,folder)
thumb_folder = abs_folder + "/thumbs"
context.folder.myexternalMethod(thumb_folder,"thumbs")
<--- here is the problem.
retval = "Ordner " + folder + " in " + abs_folder + " erstellt."
return retval
[/code]

How can i call the external Method in
context.myVariable.myexternalMethod?
I've tried many things, like the module string(which is not available in
Python-based scripts) and others...

Regards, Sebastian Kors.