[Zope] a newbie in trouble with tree tag and sql methods

Lauri Posti lauri@linnet.ee
Sun, 4 Jul 1999 19:52:04 +0300 (EEST)


hi,

i'm trying the tree tag + sql meth example that was discussed in this 
group some weeks ago.

the sql method works fine, tree tag shows the correct information, but the 
only thing wrong is that expand/collapse of tree doesnt work correctly:
the first node expands all other nodes exept itself and all other nodes
collapse all nodes.

any ideas what might be wrong??

i'm using Zope 2.0.0a3 with python1.52 on linux2.2 and postgresql6.5

the sql method i'm using is:
---
name: query argument: param
---
SELECT id as obj_id, nimi as name FROM asutus WHERE
<!--#if param-->
ylem=<!--#sqlvar param type=int-->
<!--#else-->
ylem IS NULL
<!--#/if-->

and tree tag is:
<!--#with "_.namespace(obj_id=0)"-->
 <!--#tree branches_expr="query(param=obj_id)" single=0-->
  <!--#var name-->,<!--#var obj_id-->
 <!--#/tree-->
<!--#/with-->

data im'm using is:
test=> select id,nimi as name, ylem as paernt_id from asutus;
id|name |paernt_id
--+-----+---------
 1|tty  |         
 2|ut   |         
 3|ebs  |         
 4|cyber|        1
 7|phys |        1
 8|chem |        2
 6|filo |        2
 5|keel |        2
 9|tpu  |         
10|kala |        9
11|kamm |        9
12|jura |        9
(12 rows)


Thanks in advance,

Lauri