[Zope-dev] ZPatterns bug: Compute instance has not _objectAdding method

Steve Alexander steve@cat-box.net
Mon, 28 Aug 2000 16:13:21 +0100


Zope 2.2.1, ZPatterns 0-4-1snap1, with some small patches.

I'm adding a dataskin-derived ZClass instance underneath a Customizer
folder.

The Customizer has a SkinScript plug-in.

When I try to add a new ZClass instance, I get an exception that I can
trace to the fact that DataManager's _objectAdding method is trying to
call _objectAdding on a Compute object.

DataManagers.py line 29:

    def _objectAdding(self,client):
        for ob in
self._uniqueProviders(('attributes','sheets','handlers')):
            ob._objectAdding(client)


I've temporarily fixed the problem with a test to see if the
_objectAdding attribute exists:

    def _objectAdding(self,client):
        for ob in
self._uniqueProviders(('attributes','sheets','handlers')):
            if hasattr(ob, '_objectAdding'):
                ob._objectAdding(client)


On deleting a Dataskin object, there was no error in the Zope Management
interface, but the following was logged to the console:

2000-08-28T15:05:08 ERROR(200) Zope manage_beforeDelete() threw
Traceback (innermost last):
  File /lib/python/OFS/ObjectManager.py, line 327, in _delObject
    (Object: PlugInBase)
  File /lib/python/Products/ZPatterns/DataSkins.py, line 303, in
manage_beforeDelete
    (Object: doo)
  File /lib/python/Products/ZPatterns/DataSkins.py, line 162, in
_objectDeleting
    (Object: doo)
  File /lib/python/Products/ZPatterns/DataManagers.py, line 34, in
_objectDeleting
    (Object: Transactional)
AttributeError: _objectDeleting


Therefore, I've patched _objectDeleting similarly.

The SkinScript method is:

  WITH SELF COMPUTE 
  title="foo", fish='%s, (%s)' % (id,name)

I suspect this is not the best way to solve the problem, though. Should
compiled SkinScript support these methods?

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net