[Zope] DTML Tree + SQL problem

Andrew Williams ajwms@visto.com
Thu, 27 Apr 2000 14:03:19 -0700


I'm at home today doing yard work :), but I will try to 
remember everything for you:

ZSQL Method
-----------------
Name:
  tree_query

Arguments:  
  parentid

SQL Query:
  SELECT objectid 
  FROM associative_table 
  WHERE <dtml-sqltest parentid>;
-----------------

index_html:
---------------------
...stuff
<dtml-let objectid="REQUEST.get('variable')">
  <dtml-tree id=objectid branches_exp="tree_query
(parentid=objectid)" leaves="leaves_render">
    <dtml-var objectid>
  </dtml-tree>
</dtml-let>
...more stuff
---------------------

leaves_render:
---------------------
..stuff
<dtml-in results_query>
  <dtml-var var_one>
  <dtml-var var_two>
</dtml-in>
..more stuff
---------------------

All of the above works correctly; unfortunately, expand_all 
only expands the branches, not the leaves.

Hope this is the information you were asking.

Thanks,

Andrew

btw, why can't you just put a SQL statement in there, 
should would be easier! LOL



-----Original Message-----
From:    Chris Withers chrisw@nipltd.com
Sent:    Thu, 27 Apr 2000 17:47:02 +0100
To:      ajwms@visto.com
CC:      zope@zope.org
Subject: [Zope] DTML Tree + SQL problem


> Second question dealt with <dtml-tree
> branches_exp="some_sql_statement" leaves="dtml_method>.  I
> patched the treetag.py file, but expand_all=1 does not
> expand the leaves.  I'm not sure if this is intended or is
> a bug.

I hope my "some_sql_statement" you mean a ZSQL mthod. If 
you've just put an SQL
statement between the quotes then you have an understanding 
problem of how Zope
works ;-)

Can you post me (or the list) the SQL method and the DTML 
method. Maybe even a
.zexp with containing both of them? 

cheers,

Chris

_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




__________________________________________________________________________
Visit http://www.visto.com/info, your free web-based communications center.
Visto.com. Life on the Dot.