[Zope] dtml-tree based on a recursive SQL table

Philipp Auersperg zope@philosoft.at
Sun, 17 Oct 1999 06:07:15 +0200


Hi!

given a recursive table named
 <<Category (CategoryID int primary key,parentID int foreign key references
Category.CategoryID,name varchar(30)) >>
I would like to display that table with the tree tag. On the top-level it
should display the categories where parentid=0, for each branch there should
appear the categories with their parentID pointing to the categoryID of the
branch and so on... (I hope you understand). I scanned all the docs  but did
not find any solution.

I started with:

<dtml-tree branches_expr="Category()">
   <dtml-var name>
</dtml-tree>

(Category is a Z SQL method returning the whole table)

this displays the top level records but of course not the subcategories. How
can I bring the recursion into that ?

Thanks in advance
Philipp Auersperg