--- a/ztfy/utils/site.py Sat Aug 28 02:42:28 2010 +0200
+++ b/ztfy/utils/site.py Wed Sep 08 07:45:41 2010 +0200
@@ -18,12 +18,15 @@
# import standard packages
# import Zope3 interfaces
+from zope.app.intid.interfaces import IIntIds
# import local interfaces
from interfaces import INewSiteManagerEvent
# import Zope3 packages
+from zope.app import zapi
from zope.interface import implements
+from zope.location import locate
# import local packages
@@ -35,3 +38,11 @@
def __init__(self, obj):
self.object = obj
+
+
+def locateAndRegister(contained, parent, key, intids=None):
+ locate(contained, parent)
+ if intids is None:
+ intids = zapi.getUtility(IIntIds)
+ intids.register(contained)
+ parent[key] = contained