[Zope] Tree tag and SQL methods?

Phillip J. Eby pje@telecommunity.com
Mon, 28 Jun 1999 10:59:43 -0500


At 04:40 PM 6/28/99 +0100, Tony McDonald wrote:
>I've been following the dialogue between Alexander and Phillip, and 
>today things started to click so I thought I'd have a go... :)
>
><!--#with "_.namespace(child=135,flag=0)"-->
><!--#tree id=level nowrap=1 single=1 
>branches_expr="get_parent_child_topics(theparent=child,flag=flag)"-->

Before anything else, I'd suggest you pick another field than level as your
id.  The problem is that everything on the same level has the same id, so
when you click it open, everything on that level opens.  You need something
that will be different for every possible line in your tree.  If all else
fails, you could use a pluggable brain to generate an id value from a hash
of some fields, if you don't have a nice short primary key (like an integer
or other ID code).  That's assuming there isn't an "id_expr" option that'll
do the trick.  It's been a while since I looked at the tree tag source.