Index: /waeup/branches/ulif-rewrite/src/waeup/hostel/hostelcontainer.py
===================================================================
--- /waeup/branches/ulif-rewrite/src/waeup/hostel/hostelcontainer.py	(revision 4080)
+++ /waeup/branches/ulif-rewrite/src/waeup/hostel/hostelcontainer.py	(revision 4081)
@@ -1,3 +1,5 @@
 import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
 from waeup.interfaces import IHostelContainer, IHostel
 from waeup.viewlets import MainArea, Index, Add, FormWrapMixin
@@ -21,9 +23,18 @@
         return id
 
+class HostelContainerFactory(grok.GlobalUtility):
+    """A factory for faculty containers.
+    """
+    grok.implements(IFactory)
+    grok.name(u'waeup.HostelContainer')
+    title = u"Create a new hostel container.",
+    description = u"This factory instantiates new hostel containers."
 
-# We register HostelContainer as a utility. This way we can
-# call getUtility(IHostelContainer) from anywhere in the code and
-# get an instance of HostelContainer (without importing it).
-grok.global_utility(HostelContainer, provides=IHostelContainer)
+    def __call__(self):
+        return HostelContainer()
+
+    def getInterfaces(self):
+        return implementedBy(HostelContainer)
+
 
 class AddHostelForm(grok.AddForm):
