Am Montag, 5. Juni 2006 08:14 schrieb David Johnson:
> What is the best to find the nearest utility without using a name?
> zapi.getUtility() seems to require a name (though the documentation
> implies otherwise). zapi.getAllRegisiteredUtilitiesFor() works but it
> seems to me if you have lots of utilities in other contexts, it would
> query those as well, and thereby be slow in a large application.
getUtility does not require a name.
from zope.app.zapi import getUtility
from zope.app.homefolder.interfaces import IHomeFolderManager
hfm = getUtility(IHomeFolderManager)
> I come across this problem frequently and haven't figured out the best
> way to deal with it.
Zope3-users mailing list