[Zope] From SQL query to dtml-tree, anyone?

Hannu Krosing hannu@trust.ee
Tue, 12 Oct 1999 13:00:39 +0300


Steen Suder wrote:
> 
> In my growing IT intranet app, I'd like to generate a tree based on one
> or more SQL queries.
> 
> Purpose:
> Creating a notepad tree (which ressembles the Windows programme Treepad,
> which is a sort of notepad organizer) to be used by IT staff for
> destroying the Post-IT plague.
> 
> Question:
> How do I handle data from one or more queries into a dtml-tree?
> 
> One of my preliminary ideas was two tables in the db, one with the
> note-nodes and parentID in it and another with ID and childrenID's in
> it. Then simply query from tree root and out, a bit like working in
> linked lists.

better make it just one table with (id,parent_id, and label)
and start with node where parent id =0.

then for each parent query from the table where parent_id = current id

-------
Hannu