[Zope-dev] Deleting objects in BTreeFolder

sean.upton@uniontrib.com sean.upton@uniontrib.com
Wed, 07 Nov 2001 17:01:23 -0800


Wondering why calling _delObject() in BTreeFolder, which inherits
_delObject() from ObjectManager, doesn't work with BTreeFolder._getOb(), and
I have to use BTreeFolder._delOb() to delete a contained object in a
BTreeFolder.  Is this incompatibilty by design?

I run into trouble using _delObject (traceback #1 below), getting a
deliberately raised AttributeError, but changing this to _delOb raises a key
error when calling 'del tree[id]' on line 195.

Thoughts?

Sean

=========================
Traceback #1:
Traceback (innermost last):
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 223, in
publish_module
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in publish
  File /usr/lib/zope/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
    (Object: Traversable)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in publish
  File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
    (Object: rebuildDataFromSQL)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object
    (Object: rebuildDataFromSQL)
  File /usr/lib/zope/lib/python/Products/a4Profiles/ZopeCirculation.py, line
169, in rebuildDataFromSQL
    (Object: Traversable)
  File /usr/lib/zope/lib/python/OFS/ObjectManager.py, line 340, in
_delObject
    (Object: Traversable)
  File /usr/lib/zope/lib/python/Products/BTreeFolder/BTreeFolder.py, line
179, in _getOb
    (Object: Traversable)
AttributeError: (see above)

=========================
Traceback #2:
Traceback (innermost last):
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 223, in
publish_module
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in publish
  File /usr/lib/zope/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
    (Object: Traversable)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in publish
  File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
    (Object: rebuildDataFromSQL)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object
    (Object: rebuildDataFromSQL)
  File /usr/lib/zope/lib/python/Products/a4Profiles/ZopeCirculation.py, line
169, in rebuildDataFromSQL
    (Object: Traversable)
  File /usr/lib/zope/lib/python/Products/BTreeFolder/BTreeFolder.py, line
195, in _delOb
    (Object: Traversable)
KeyError: (see above)



=========================
Sean Upton
Senior Programmer/Analyst
SignOnSanDiego.com
The San Diego Union-Tribune
619.718.5241
sean.upton@uniontrib.com
=========================