[Zope-CMF] Re: [CMF 2.1] FSPageTemplate & Unicode

Hanno Schlichting plone at hannosch.info
Sat Jan 6 17:35:51 EST 2007


Philipp von Weitershausen wrote:
> On 6 Jan 2007, at 23:22 , Martin Aspeli wrote:
> 
> Actually, why dont you keep a simple mapping between existing names and
> interfaces, e.g.:
> 
> name2iface = {'portal_catalog': ICatalog,
>              'portal_skins': ISkinTool,
>               ...}
> 
> and use that in getToolByName? Then *all* of the existing code base
> continues to work, especially if getToolByName does aq wrapping.
> getToolByName('some.dotted.interface.IName') looks silly.

We already have that. It's called _tool_interface_registry and can be
found in CMFCore/utils.py ;)

This is used in getToolByName first and only if the name is not
registered it falls back to the old Acquisition-based approach.

Hanno



More information about the Zope-CMF mailing list