Hi
I am new in Zope 3 world, i have read the book " Web Component Development
with Zope 3" 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.
Up to now i have managed to construct something like this:

class IGrandson(Interface):
   age=Int(
      title=_(u'Age'),
      description=_(u'The age of the Grandson'),
      required=True
    )
   name=TextLine(
        title=_(u'Name'),
        description=_(u"The name of the Grandson"),
        required=True
        )

class ISon(Interface):
    name=TextLine(
        title=_(u'Name'),
        description=_(u'Name of the Son'),
        required=True,
        )
    grandsons=List(
        title=_('Grandsons'),
        description=_("A list of Grandsons"),
        required=False,
        value_type=Object(
            title=_('Grandson'),
            schema=IGrandson
            )
        )

However, in this way i can only create Sons. Grandsons will be added as an
element of the Son''s grandsons list. If I want to create a Grandson without
father, how can I add it later to the Son''s list?

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:

grandsons=OOBTree(
        title=_('Grandsons'),
        description=_("A list of Grandsons"),
        required=False,
        value_type=Object(
            title=_('Grandson'),
            schema=IGrandson
            )
        )

nor

grandsons=Object(
            title=_('Grandson'),
            schema=OOBTree

        )

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?

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.

I appretiate much your help and ideas. Thanks in advance.

Jeronimo
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to