Thanks for your answer, but the problem remains the same under 2.1.6. Since I read in this newsgroup that other users have other stability problems wirth ZSQL under Zope 2.1.5 and 2.1.6 I installed 2.1.4 and everything works fine. I think I will wait some minor releases before I try a new upgrade phil *********** REPLY SEPARATOR *********** On 29.04.00 at 07:41 Andrew Williams wrote:
Try this:
SQL Method: ----------- Name: itemquery Arguments: parentID Query: SELECT item.itemid FROM item WHERE <dtml-sqltest parentID type=int>; -----------
DTML Method: ------------ ...stuff <dtml-let ItemID="-1"> <dtml-tree id=ItemID branches_expr="itemquery (parentID=ItemID)"> <a><dtml-var ItemID>: <dtml-var name></a> <br> </dtml-tree>
</dtml-let> ...more stuff ------------
It looks like your SQL-Query is where the problem is: where parentID=<dtml-var parentID> when called by the dtml-method is basically going to be where parentid=parentid which is a circular reference.
If you change the sql statement to the one above, then sql- method will evaluate out to: where parentid=item which is what you want.
Hope this helps.
Andrew
-----Original Message----- From: Philipp Auersperg zope@philosoft.at Sent: Sat, 29 Apr 2000 04:43:42 +0200 To: zope@zope.org Subject: [Zope] tree-tag & SQL - works not properly with zope 2.1.6
I use a recursive table to implement a hierarchical structure in SQL and the Zope tree tag to display it. This works perfect with Zope 2.0.1 recently I upgraded to 2.1.6. Since then it does not work correct. What did I do wrong and what can I do to correct the problem?
thanks in advance phil
Here the exact description of what I did:
1. SQL statement: ---------------------- create table Item(ItemId int,parentID int,name varchar(30))
2. In Zope I defined a SQL Method called 'Item' with an argument called 'parentID': ------------------------------------------------------------ ---- select * from Item where parentID=<dtml-var parentID>
3. I defined a DTML document to display the tree: ------------------------------------------------------------ --------- <!--#var standard_html_header-->
<dtml-let ItemID="-1"> <dtml-tree id=ItemID branches_expr="Item(parentID=ItemID)"> <dtml-var name> </a> <br> </dtml-tree>
</dtml-let> <!--#var standard_html_footer-->
----------------------------------
__________________________________________________________________________ Visit http://www.visto.com/info, your free web-based communications center. Visto.com. Life on the Dot.
_______________________________________________ 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 )