[Zope] BTreeFolder inheritance problem

Thierry Florac thierry.florac@onf.fr
16 Dec 2002 16:47:05 +0100


On Mon, 2002-12-16 at 14:11, Thierry Florac wrote:
> I've created a new product (for Zope-2.6), which inherit from
> BTreeFolder as well as another custom product (not a container) of my
> own.
> When I try to add a new item in my folder, I receive an error message.
> For example, 
> 
>   class MyBTreeFolder (BTreeFolder):
>     def __init__ (self, id, title=None, REQUEST=None):
>       ""
>       self.id = id
>       self.title = title
>       folder = Folder (id='archives')
>       set._setObject (folder.id, folder)
>       ...
> 
> At runtime, I receive the following error :
> 
>   Traceback (innermost last):
> 
>     * Module ZPublisher.Publish, line 98, in publish
>     * Module ZPublisher.mapply, line 88, in mapply
>     * Module ZPublisher.Publish, line 39, in call_object
>     * Module Products.Intraforet.MyBTreeFolder, line 428, in
> manage_addMyBTreeFolder
>     * Module Products.Intraforet.MyBTreeFolder, line 138, in __init__
>     * Module OFS.ObjectManager, line 256, in _setObject
>     * Module Products.BTreeFolder.BTreeFolder, line 187, in _setOb
> 
>   TypeError: object does not support item assignment
> 

Well... after a few additional tests, I finally managed to make my
product work correctly...
In fact, I just forgot to put 'SimpleItem' as the last inherited class
on my product, and I also forgot to call "BTreeFolder.__init__" in my
own constructor...

Thierry