ZPatterns bug: Compute instance has not _objectAdding method
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
At 04:13 PM 8/28/00 +0100, Steve Alexander wrote:
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.
I actually fixed this problem about three weeks ago, but neglected to publish the code. :( In the latest version, all of the objects which the SkinScript compiler creates are derived from a class "NullProvider" which has empty methods for all the _objectXing events, including _objectChanging. Luckily, there is not much more to do for the new release (0.4.2b1) besides updating the release-related files, and perhaps a bit more work on improving the management screens for SkinScript methods.
participants (2)
-
Phillip J. Eby -
Steve Alexander