[Zope] Tree hierarchy problem with database

juangar@dei.inf.uc3m.es juangar@dei.inf.uc3m.es
Thu, 6 Sep 2001 08:18:23 +0200


Hi,

I have a problem with the tree tag. I want to show in the page a
hierarchy with codes of a database. I've read in this page:

http://www.zope.org/Members/anthony/tree-coding-tricks

an example of how to do it but it doesn't work in my case.
In the example Anthony creates this SQL method:

SELECT objectid, objectname
FROM myobjects
WHERE
<dtml-sqltest parentid type=int>

and this is the code of the DTML Method:

<dtml-let objectid="0">
<dtml-tree id=objectid branches_expr="child_lookup(parentid=objectid)">
<b><dtml-var objectname></b> <dtml-var objectid>
</dtml-tree>
</dtml-let>

I have created an SQL method like in the example called lrecursos
(which works properly), and this is my DTML Method:

<dtml-let objectid="'0'">
<dtml-tree id=objectid branches_expr="lrecusos(codigo_recurso=objectid)">
<b><dtml-var codigo_recurso></b>
</dtml-tree>
</dtml-let>

The problem is that it does not show the tree properly, it only shows
the tree properly at the begining, when I want to expand the tree it
shows in the next levels of the tree the elements that are at the
highest level. What can I do? I think that the problem is that objectid
does not change.

bye, bye ...