Martijn Pieters wrote:
On 9/15/06, Rob Campbell <[EMAIL PROTECTED]> wrote:
I just recently started trying out Zope 3.  My first test project is a
few containers that can contain other containers or an object.  They are
laid out as follows:

-> FosterSource
     -> Foster
     -> FosterGroup
        -> Foster

A FosterRecord is the top level container and can contain a
FosterSource.  A FosterSource can contain a Foster object or a
FosterGroup.  And a FosterGroup can contain a Foster object.

You cannot combine multiple contained or container constraints; you'll
have to define a contained contstraint for the Foster implementation
that includes both IFosterSource and IFosterGroup.

Ok, so it can't be done by implementing both IFosterSourceContained and IFosterGroupContained? I am doing that currently with the following code:

class Foster(Contained):

  implements(IFoster, IFosterSourceContained, IFosterGroupContained)

Would I need to create a new IContained interface? Maybe something like this:

class IFosterSourceOrGroupContained(IContained):

  containers(IFosterSourceContainer, IFosterGroupContainer)

and then change Foster to this:

class Foster(IContained):

  implements(IFoster, IFosterSourceOrGroupContained)

Thank you for the help.

Rob Campbell
Zope3-users mailing list

Reply via email to