Hi,

On Sun, Jan 07, 2007 at 02:10:20PM +0100, Christophe Combelles wrote:

[snip]

> I understand there is an inconsistency between these two interfaces, and this 
> is not a correct solution.
> But using just containers() on content objects doesn't prevent their 
> containers
> >from displaying everything in the Add Menu.
> It just prevents from adding these objects in other containers.

You could use a another interface (i.e. IForOrBar) and something like

 class IFoo(IFooOrBar):
    pass
 
 class IBar(IFooOrBar):
    pass
 
 class IFooContainer(Interface):
    contains(IFooOrBar)
 
 class IBarContainer(Interface):
    contains(IFooOrBar)
 
 class IFooBarContainer(IFooContainer,IBarContainer):
    pass
 
 This way, Foo and Bar have to depend on another package (The one containing
 IFooOrBar). Neither does this package need to know anything about IFoo or IBar,
 nor does IFoo have to know anything about IBar or vice versa.
 
 Regards,
 
 Frank
 
 
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to