[Zope3-dev] getUtilitiesFor and duplicate names

Garrett Smith garrett at mojave-corp.com
Fri May 14 16:58:00 EDT 2004


getUtilitiesFor returns all active utilities that provide a specified 
interface, including utilties with the same name (located in different 
sites).

This means its possible to list utilites that you could not lookup via 
getUtility for a particular context.

Is this by design?

This implementation makes it difficult to use getUtiltiesFor to 
enumerate the actual list of available utilities available for a given 
context. E.g. I suspect I'll have to a) check for duplicate names and b) 
use getUtility for each instance of a duplicate name to see which 
utility is actually available in the specified context.

  -- Garrett





More information about the Zope3-dev mailing list