[Zope] tree-tag & SQL - works not properly with zope 2.1.6

Philipp Auersperg zope@philosoft.at
Sat, 29 Apr 2000 04:43:42 +0200


--=====_95697622218467=_
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

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=3D<dtml-var parentID>

3. I defined a DTML document to display the tree:
---------------------------------------------------------------------
<!--#var standard_html_header-->

<dtml-let ItemID=3D"-1">
<dtml-tree id=3DItemID branches_expr=3D"Item(parentID=3DItemID)">
 <dtml-var name> </a>
<br>
</dtml-tree>

</dtml-let>
<!--#var standard_html_footer-->

----------------------------------

Under Zope 2.0.1 the tree displays correct:

world 

europe 

austria 

belgium 

denmark 

france 

germany 

italy 

netherla 

switzerl 

northamerica 


Under Zope 2.1.6 exact the same code displays like this:
world 

europe 

europe 

europe 

europe 

europe 

europe 

northamerica 

northamerica 

northamerica 

northamerica 

northamerica 

northamerica 


--=====_95697622218467=_
Content-Type: text/html; charset="us-ascii"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff style="FONT-FAMILY: Arial; FONT-SIZE: x-small" 
text=#000000>
<DIV>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</DIV>
<DIV>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?</DIV>
<DIV>&nbsp;</DIV>
<DIV>thanks in advance</DIV>
<DIV>phil</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here the exact description of what I did:</DIV>
<DIV>&nbsp;</DIV>
<DIV>1. SQL statement:</DIV>
<DIV>----------------------</DIV>
<DIV>create table Item(ItemId int,parentID int,name varchar(30))</DIV>
<DIV>&nbsp;</DIV>
<DIV>2. In Zope I defined a SQL Method called 'Item' with an argument called 
'parentID':</DIV>
<DIV>----------------------------------------------------------------</DIV>
<DIV>select * from Item where parentID=&lt;dtml-var parentID&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>3. I defined a DTML document to display the tree:</DIV>
<DIV>---------------------------------------------------------------------</DIV>
<DIV>&lt;!--#var standard_html_header--&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;dtml-let ItemID="-1"&gt;<BR>&lt;dtml-tree id=ItemID 
branches_expr="Item(parentID=ItemID)"&gt;<BR>&nbsp;&lt;dtml-var name&gt; 
&lt;/a&gt;<BR>&lt;br&gt;<BR>&lt;/dtml-tree&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;/dtml-let&gt;<BR>&lt;!--#var standard_html_footer--&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>----------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV>Under Zope 2.0.1 the tree displays correct:</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<P>
<TABLE cellSpacing=0>
  <TBODY>
  <TR>
    <TD vAlign=top width=16><A name=2></A>
      <DIV><A 
      href="http://192.7.2.2:9080/Tests/TreeTest/Kat/ItemTree?tree-c=eJyLVneEAqcSC1t1HQWjWAAwegS4#2"><IMG 
      border=0 src="http://192.7.2.2:9080/p_/mi"></A></DIV></A></TD>
    <TD align=left colSpan=4 vAlign=top>
      <DIV>world </A><BR></DIV></TD></TR>
  <TR>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD vAlign=top width=16><A name=3></A>
      <DIV><A 
      href="http://192.7.2.2:9080/Tests/TreeTest/Kat/ItemTree?tree-c=eJyLVneEAqcSC1t1HQUjHQXjWAA/AQU3#3"><IMG 
      border=0 src="http://192.7.2.2:9080/p_/mi"></A></DIV></A></TD>
    <TD align=left colSpan=3 vAlign=top>
      <DIV>europe </A><BR></DIV></TD></TR>
  <TR>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD align=left colSpan=2 vAlign=top>
      <DIV>austria </A><BR></DIV></TD></TR>
  <TR>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD align=left colSpan=2 vAlign=top>
      <DIV>belgium </A><BR></DIV></TD></TR>
  <TR>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD align=left colSpan=2 vAlign=top>
      <DIV>denmark </A><BR></DIV></TD></TR>
  <TR>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD align=left colSpan=2 vAlign=top>
      <DIV>france </A><BR></DIV></TD></TR>
  <TR>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD align=left colSpan=2 vAlign=top>
      <DIV>germany </A><BR></DIV></TD></TR>
  <TR>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD align=left colSpan=2 vAlign=top>
      <DIV>italy </A><BR></DIV></TD></TR>
  <TR>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD align=left colSpan=2 vAlign=top>
      <DIV>netherla </A><BR></DIV></TD></TR>
  <TR>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD>
      <DIV>&nbsp;</DIV></TD>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD align=left colSpan=2 vAlign=top>
      <DIV>switzerl </A><BR></DIV></TD></TR>
  <TR>
    <TD width=16>
      <DIV>&nbsp;</DIV></TD>
    <TD vAlign=top width=16><A name=24></A>
      <DIV><A 
      href="http://192.7.2.2:9080/Tests/TreeTest/Kat/ItemTree?tree-e=eJyLVneEAqcSC1t1HQUjIDKJBQBEQAVq#24"><IMG 
      border=0 src="http://192.7.2.2:9080/p_/pl"></A></DIV></A></TD>
    <TD align=left colSpan=3 vAlign=top>
      <DIV>northamerica </A><BR></DIV></TD></TR></TBODY></TABLE></P></DIV>
<DIV>Under Zope 2.1.6 exact the same code displays like this:</DIV>
<DIV>
<TABLE cellSpacing=0>
  <TBODY>
  <TR>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-c=eJyLVneEAY9AW3UdBaNYAC/ABKQ#2" 
      name=2><IMG alt=- border=0 
      src="http://www.bluedynamics.com:9080/p_/mi"></A></TD>
    <TD align=left colSpan=7 vAlign=top>world </A><BR></TD></TR>
  <TR>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-c=eJyLVneEAY9AW3UdBSMdBeNYAD4LBSM#3" 
      name=3><IMG alt=- border=0 
      src="http://www.bluedynamics.com:9080/p_/mi"></A></TD>
    <TD align=left colSpan=6 vAlign=top>europe </A><BR></TD></TR>
  <TR>
    <TD noWrap width=16></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-c=eJyLVneEAY9AW3UdBSMdBWMgigUATdMFog#3" 
      name=3><IMG alt=- border=0 
      src="http://www.bluedynamics.com:9080/p_/mi"></A></TD>
    <TD align=left colSpan=5 vAlign=top>europe </A><BR></TD></TR>
  <TR>
    <TD noWrap width=16></TD>
    <TD noWrap width=16></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-c=eJyLVneEAY9AW3UdBSMdBWMIigUAXxgGIQ#3" 
      name=3><IMG alt=- border=0 
      src="http://www.bluedynamics.com:9080/p_/mi"></A></TD>
    <TD align=left colSpan=4 vAlign=top>europe </A><BR></TD></TR>
  <TR>
    <TD colSpan=3 noWrap></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-c=eJyLVneEAY9AW3UdBSMdBWM4igUAcdoGoA#3" 
      name=3><IMG alt=- border=0 
      src="http://www.bluedynamics.com:9080/p_/mi"></A></TD>
    <TD align=left colSpan=3 vAlign=top>europe </A><BR></TD></TR>
  <TR>
    <TD colSpan=4 noWrap></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-c=eJyLVneEAY9AW3UdBSMdBWNkFAsAhhkHHw#3" 
      name=3><IMG alt=- border=0 
      src="http://www.bluedynamics.com:9080/p_/mi"></A></TD>
    <TD align=left colSpan=2 vAlign=top>europe </A><BR></TD></TR>
  <TR>
    <TD colSpan=5 noWrap></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-e=eJyLVneEAY9AW3UdBSMdBWM0FAsAm9UHng#3" 
      name=3><IMG alt=+ border=0 
      src="http://www.bluedynamics.com:9080/p_/pl"></A></TD>
    <TD align=left vAlign=top>europe </A><BR></TD></TR>
  <TR>
    <TD colSpan=5 noWrap></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-e=eJyLVneEAY9AW3UdBSMdBWNUZGQSCwCjewfR#24" 
      name=24><IMG alt=+ border=0 
      src="http://www.bluedynamics.com:9080/p_/pl"></A></TD>
    <TD align=left vAlign=top>northamerica </A><BR></TD></TR>
  <TR>
    <TD colSpan=4 noWrap></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-e=eJyLVneEAY9AW3UdBSMdBWMkZGQSCwCNQAdS#24" 
      name=24><IMG alt=+ border=0 
      src="http://www.bluedynamics.com:9080/p_/pl"></A></TD>
    <TD align=left colSpan=2 vAlign=top>northamerica </A><BR></TD></TR>
  <TR>
    <TD colSpan=3 noWrap></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-e=eJyLVneEAY9AW3UdBSMdBWMYMjKJBQB4ggbT#24" 
      name=24><IMG alt=+ border=0 
      src="http://www.bluedynamics.com:9080/p_/pl"></A></TD>
    <TD align=left colSpan=3 vAlign=top>northamerica </A><BR></TD></TR>
  <TR>
    <TD noWrap width=16></TD>
    <TD noWrap width=16></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-e=eJyLVneEAY9AW3UdBSMdBWMwMjKJBQBlQQZU#24" 
      name=24><IMG alt=+ border=0 
      src="http://www.bluedynamics.com:9080/p_/pl"></A></TD>
    <TD align=left colSpan=4 vAlign=top>northamerica </A><BR></TD></TR>
  <TR>
    <TD noWrap width=16></TD>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-e=eJyLVneEAY9AW3UdBSMdBWMgaRILAFN9BdU#24" 
      name=24><IMG alt=+ border=0 
      src="http://www.bluedynamics.com:9080/p_/pl"></A></TD>
    <TD align=left colSpan=5 vAlign=top>northamerica </A><BR></TD></TR>
  <TR>
    <TD noWrap width=16></TD>
    <TD noWrap vAlign=top width=16><A 
      href="http://www.bluedynamics.com:9080/TreeTest/Kat/ItemTree?tree-e=eJyLVneEAY9AW3UdBSMgMokFAEM2BVY#24" 
      name=24><IMG alt=+ border=0 
      src="http://www.bluedynamics.com:9080/p_/pl"></A></TD>
    <TD align=left colSpan=6 vAlign=top>northamerica 
</A><BR></TD></TR></TBODY></TABLE>
<P><A href="http://www.zope.org/Credits" target=_top><IMG alt="Powered by Zope" 
border=0 height=50 src="http://www.bluedynamics.com:9080/p_/ZopeButton" 
width=115></A></P></DIV></BODY></HTML>


--=====_95697622218467=_--