[Zope] Populating a #tree tag with data from an SQL query?
Tony McDonald
tony.mcdonald@ncl.ac.uk
Wed, 23 Jun 1999 17:58:36 +0100
Anyone got any pointers on how to do this?
I currently have a system that outputs a structured menu like so;
Theme A: The Cell
Cells and tissues, ...
Description
Departments
Aims and Objectives
Overall Aims
Specific Objectives
Transferable Skills
Content
Teaching Methods
Lectures
Practical Sessions
Self-Directed Study
Assessment
etc.etc.
This is done with DTML (excuse it's quality...) like;
<!--#in expr="get_topics(theguide=id)"-->
<!--#if "level==2"-->
<font size=3>
<!--#/if-->
<!--#if "level==3"-->
<font size=2>
<!--#/if-->
<!--#if "level==4"-->
<font size=1>
<!--#/if-->
<!--#if "level==5"-->
<font size=1>
<!--#/if-->
<a href="show_headers?child=<!--#var tag_id-->"><!--#var header
size=25--></a></font>
<!--#/in-->
where get_topics is
select thetag, class, content, level, header as header, tag_id from
element where thetag = 'topic' and guideid = '<!--#var theguide-->'
order by sequence;
So, you see that I get the level information and other good stuff
from the query. Is there any way to get #tree involved (now *that*
would make for a killer system!).
The data from get_topics doesn't change (often) so if it's easier to
populate a lines property or a TinyTable object than that's ok (just
need to use the manage_*** methods I guess!). I'd just like to know
if this is possible or a waste of time ...
cheers
tone.
------
Dr Tony McDonald, FMCC, Networked Learning Environments Project
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2