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/ ;)

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


Zope-CMF maillist  -

See for bug reports and feature requests

Reply via email to