[Zope-CMF] [CMF 2.1] opaque items calls make performance issue

Charlie Clark charlie at begeistert.org
Sun Aug 9 15:03:23 EDT 2009


Am 09.08.2009, 04:48 Uhr, schrieb Martin Aspeli <optilude+lists at gmail.com>:

>>> self_base = aq_base(self)
>>> for name in self_base.__dict__.keys()
>>>    obj = getattr(self, name)
>>>    if ICallableOpaqueItem.providedBy(obj):
>>>      items.append((obj.getId(), obj))
> That's just *nuts*!

 From my previous answer to this which I forgot to send to the list as well  
- can we change the list settings so that answers go to it by default?


CMF maintains pretty extensive backwards compatability.

A similar question came up a couple of years ago and produced this  
response from Tres:

http://mail.zope.org/pipermail/zope-cmf/2007-March/025754.html

ie. there is no reason why this should not be deprecated and replaced.

Returning to the original questions:

But z2ICallableOpaqueItem is a Zope2 interface and I m not used to this
kind of object. It seems they are generated on runtime, so for me it's
hard to debug.

No, it's simply renamed on import in CMFCatalogAware

* What are opaqueitems (any example ? I don't have find anything usefull
in tests of CMFCore)

     """ Interface for callable opaque items.

     o Opaque items are subelements that are contained using something that
       is not an ObjectManager.

     o On add, copy, move and delete operations, a marked opaque items
       'manage_afterAdd', 'manage_afterClone' and 'manage_beforeDelete'
       hooks get called if available. Unavailable hooks do not throw
       exceptions.
     """

DiscussionItems are ICallableOpaqueItems

* Is zope2 interface are still used and why ?

For anything that uses OpaqueItems. From Tres' post it's pretty unlikely  
that this is the case. The z2I "import as" has been removed in CMF trunk.

* How could I replace those calls, or improved this code that always
return an empty tuple

In you own deployments I suggest simply overriding the code to do just  
that.

Charlie
-- 
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226


More information about the Zope-CMF mailing list