<div dir="ltr">Hi<br>I am new in Zope 3 world, i have read the book &quot; Web Component Development with Zope 3&quot; and I am designing a Zope application which involves a multiple-level object structure in which the father class has multiple instances of son class and the son class has multiple objects of the grandson class. <br>
Up to now i have managed to construct something like this:<br><br>class IGrandson(Interface):<br>&nbsp;&nbsp; age=Int(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; title=_(u&#39;Age&#39;),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; description=_(u&#39;The age of the Grandson&#39;),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; required=True<br>
&nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp; name=TextLine(<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; title=_(u&#39;Name&#39;),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; description=_(u&quot;The name of the Grandson&quot;),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; required=True<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br><br>class ISon(Interface):<br>&nbsp;&nbsp;&nbsp; name=TextLine(<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; title=_(u&#39;Name&#39;),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; description=_(u&#39;Name of the Son&#39;),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; required=True,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; grandsons=List(<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; title=_(&#39;Grandsons&#39;),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; description=_(&quot;A list of Grandsons&quot;),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; required=False,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; value_type=Object(<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; title=_(&#39;Grandson&#39;),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; schema=IGrandson<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br><br>However, in this way i can only create Sons. Grandsons will be added as
an element of the Son&#39;&#39;s grandsons list. If I want to create a Grandson without
father, how can I add it later to the Son&#39;&#39;s list?<br><br>Is the List the most effective way to store objects? I have tried with BTrees, but then i have problems to construct the widgets and views to add elements to the BTree and i think BTrees is not an interfaces so I cannot do something like:<br>
<br>grandsons=OOBTree(<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; title=_(&#39;Grandsons&#39;),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; description=_(&quot;A list of Grandsons&quot;),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; required=False,<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; value_type=Object(<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; title=_(&#39;Grandson&#39;),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; schema=IGrandson<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br><br>nor<br><br>grandsons=Object(<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; title=_(&#39;Grandson&#39;),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; schema=OOBTree<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br><br>Also, considering that the structure can grow up to four generations (granpa, father, son, grandson), what will be the best approach to achieve this mult-level structure?<br><br>My initial idea was to present in the first view the Granpas. When selecting one of them, its attributes will be shown, among them its sons (the Fathers). Then when selecting one of them, the process will repeat until the grandson. <br>
<br>I appretiate much your help and ideas. Thanks in advance.<br><br>Jeronimo<br><br><br></div>