[Zope3-dev] registering nameless utilities

Jim Fulton jim at zope.com
Mon May 10 05:38:08 EDT 2004


Garrett Smith wrote:
> I want to lookup a utility using:
> 
>   zapi.getUtility(iface)
> 
> When I try to register a local utility with a site manager, the UI 
> insists I provide a name. (The 'name' attribute of IUtilityRegistration 
> is required.)

This is undoubtably due to the fact that the schema system, unfotunately,
can't tell the differene between an empty string and one that hasn't been
provided, even when the minimum string length is 0.

> How can I register a 'nameless' utility?

You will need to "fix" utility egistrations so that the name is not requird.
I think you also need to set the missing value to ''.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope3-dev mailing list