I have a function that is called every 60 seconds from zope.scheduler. Due to
that it does not have a context. However I need to call a utility. I use that
piece of code:
""" Calls all utlities that have a INewsfeed interface registered. """
import pdb; pdb.set_trace()
db = getUtility(ZODB.interfaces.IDatabase)
conn = db.open()
root = conn.root().data['Application']
utils = getUtilitiesFor(INewsfeed)
for i in utils:
print "Utility called:", i
This works fine as long as the registered utility is in root site. As soon as
it is in another site it does not find the utility anymore.
How can I fix that?
Zope3-users mailing list