Dear Frank,

i think i did something similar
first to define the category container, and contained
and this is working fine, i can add new category objects into the
category container.

i have problem with the next level, whereas the category, which is
contained from the category point of view, but it is a container from
the type point of view.
how can i define this ?

On 3/14/07, FB <[EMAIL PROTECTED]> wrote:
On Wed, Mar 14, 2007 at 04:35:53PM +0100, Ivan Horvath wrote:
> Dear All,
>
> i'm really new to zope, but i have learning application, where the
> object stru is little bit complex.
>
> App
>  |
>  +---- Categories
>                |
>                +------Categ1
>                             |
>                             +----Type1
>                                       |
>                                       +-----Article1
>                                                  |
>                                                  +------Article2
>                             +-----Type2
>
>                +------Categ2
> +----- Administration
> etc
>
> i could manage the administration part and in the categories container
> i can add new category objects.
> but i cannot add into a category object a type container.
> i don't really know how to define an interface which is contained and
> container too.

I'm not sure, if I understand your problem correctly. It's possible to
define a set of valid subobjects for each interface:

class IType(IContainer):
   pass

class ICategory(IContainer):
   contains(IType)

class ICategoryContainer(IContainer):
   contains(IType)

[...]

class Type(BTreeContainer):
   implements(IType)

class Category(BTreeContainer):
   implements(ICategory)

class CategoryContainer(BTreeContainer):
   implements(ICategoryContainer)

There's nothing special about those kind of "constraint-trees". Now I'm
guessing: did you forget to specify a <browser:containerViews> and a
<browser:addMenuItem> ZCML-directive per class?

Regards,

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

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

Reply via email to