[Zope] Deleting several items from BTrees

Thomas Guettler Thomas Guettler <thomas@thomas-guettler.de>
Mon, 7 Apr 2003 18:53:40 +0200


On Mon, Apr 07, 2003 at 06:28:30PM +0200, Oliver Bleutgen wrote:
> Thomas Guettler wrote:
> >Hi!
> >
> >I had problems to delete all entries from a BTree.
> 
> self.manage_delObjects(self.objectIds())

The result:

Error Type: TypeError
Error Value: object doesn't support item deletion

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.OOPServer.Demo.Demo, line 200, in deleteAllObjects
    * Module OFS.ObjectManager, line 448, in manage_delObjects

TypeError: object doesn't support item deletion

My object is inherited from the following classes: SimpleItem,
Persistent, Implicit, CatalogAware

The container is a BTreeFolder2. 

objectIds() does not return a list, but: <OOBTreeItems object at 0x93b1a68>

BTW, the problem is not important, because my code works. I am just
looking for cleaner solution.

 thomas

-- 
Thomas Guettler <guettli@thomas-guettler.de>
http://www.thomas-guettler.de