Max M wrote:
> 
> I have made a product that inherits:
> "OFS.ObjectManager.ObjectManager"
> and so should be able to contain other object.

In python any object can be a container, the use of the ObjectManager
assists in creating an api and ui for the container's management of
objects.

> I have given the product a manage option:
> {'label':'Contents', 'action':'manage_main'}
> This is inherited from ObjectManager, To make it possible to
> add content to my product.
> 
> But when I add ie. a dtml method to my folderish object, it does it
> allright, and the document gets added. I know because I can see it directly
> when going to it's url. And if I try to add another document with the same
> name I get an error saying that the id is allready used.
> 
> But the Item doesn't show up in Itemlist on the "manage_main" page. So I
> cannot edit the items that I have added.
> 
> I only get the:
> "There are currently no items in XXX"

some more information on what you changed in the container would be
useful.

> Why is this? is there any special methods or something that I need to create
> for the Items to show up in "objectItems".

this pseudo code should give you the result you want?, it works for me
to display objects in the manage_main. 


def manage_addMyContainer:
        foo = MyContainer()
        bar = MyObject()

        foo._setObject(bar, 'bar')

        self._setObject(foo, 'foo')

caveat, register your permissions properly on the manage_add, and note
that adding bar in this way will mean it won't have access to
acquisition properties from further up the tree at creation (including
manage_afterAdd).

also for registering manage options this syntax is a little more
inclusive.

        manage_options=(
                OFS.ObjectManager.ObjectManager.manage_options+
                (
                {'label':'YourTabHere', 'action':'YourMethodHere'},
                )+
                AccessControl.Role.RoleManager.manage_options+
                OFS.SimpleItem.SimpleItem.manage_options
        )

hth

kapil

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to