Index: main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 9196)
+++ main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 9197)
@@ -130,5 +130,7 @@
     form_fields = grok.AutoFields(IHostelsContainer)
     taboneactions = [_('Save')]
-    tabtwoactions = [_('Add hostel'), _('Remove selected')]
+    tabtwoactions = [_('Add hostel'),
+        _('Clear all hostels'),
+        _('Remove selected')]
 
     def update(self):
@@ -164,4 +166,12 @@
         return
 
+    @jsaction(_('Clear all hostels'))
+    def clearHostels(self, **data):
+        self.context.clearAllHostels()
+        self.flash(_('All hostels cleared.'))
+        write_log_message(self, 'all hostels cleared')
+        self.redirect(self.url(self.context, '@@manage')+'?tab2')
+        return
+
     @action(_('Save'), style='primary')
     def save(self, **data):
@@ -232,5 +242,6 @@
     tabtwoactions = [_('Update all beds'),
         _('Switch reservation of selected beds'),
-        _('Release selected beds')]
+        _('Release selected beds'),
+        _('Clear hostel')]
     not_occupied = NOT_OCCUPIED
 
@@ -243,4 +254,5 @@
         tabs.need()
         datatable.need()
+        warning.need()
         self.tab1 = self.tab2 = ''
         qs = self.request.get('QUERY_STRING', '')
@@ -327,4 +339,12 @@
         return
 
+    @jsaction(_('Clear hostel'))
+    def clearHostel(self, **data):
+        self.context.clearHostel()
+        self.flash(_('Hostel cleared.'))
+        write_log_message(self, 'cleared')
+        self.redirect(self.url(self.context, '@@manage')+'?tab2')
+        return
+
 class BedManageFormPage(KofaEditFormPage):
     """ View to edit bed data
Index: main/waeup.kofa/trunk/src/waeup/kofa/hostels/container.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/hostels/container.py	(revision 9196)
+++ main/waeup.kofa/trunk/src/waeup/kofa/hostels/container.py	(revision 9197)
@@ -51,4 +51,11 @@
         return
 
+    def clearAllHostels(self):
+        """Clear all hostels.
+        """
+        for hostel in self.values():
+            hostel.clearHostel()
+        return
+
     logger_name = 'waeup.kofa.${sitename}.hostels'
     logger_filename = 'hostels.log'
Index: main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py	(revision 9196)
+++ main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py	(revision 9197)
@@ -51,16 +51,10 @@
 
     def clearHostel(self):
-        """Remove all beds.
-
-        This methods is pretty fast and optimized. Use it instead of
-        removing all items manually yourself.
-        """
-        # This internal function is implemented in C and thus much
-        # faster as we could do it in pure Python.
-        self._SampleContainer__data.clear()
-        # The length attribute is 'lazy'. See `zope.container` for details.
-        # This way we make sure, the next time len() is called, it returns
-        # the real value and not a cached one.
-        del self.__dict__['_BTreeContainer__len']
+        """Remove all beds
+        """
+        keys = [i for i in self.keys()] # create deep copy
+        for bed in keys:
+            del self[bed]
+        return
 
     def addBed(self, bed):
Index: main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py	(revision 9196)
+++ main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py	(revision 9197)
@@ -57,4 +57,8 @@
         default = [],
         )
+
+    def clearAllHostels():
+        """Clear all hostels.
+        """
 
 class IHostel(IKofaObject):
Index: main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 9196)
+++ main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 9197)
@@ -19,4 +19,5 @@
 Tests for hostels and their UI components.
 """
+import os
 import shutil
 import tempfile
@@ -349,2 +350,39 @@
         results = [x for x in results]
         assert len(results) == 0
+
+    def test_clear_hostels(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.container_path)
+        self.browser.getLink("Manage accommodation").click()
+        self.browser.getControl("Add hostel").click()
+        self.browser.getControl("Create hostel").click()
+        hall = self.app['hostels']['hall-1']
+        hall.blocks_for_female = ['A','B']
+        hall.rooms_per_floor = 1
+        hall.beds_for_fresh = ['A']
+        hall.beds_for_returning = ['B']
+        hall.beds_for_final = ['C']
+        hall.beds_for_all = ['D','E']
+        self.browser.open(self.container_path + '/hall-1/manage')
+        self.browser.getControl("Update all beds").click()
+        cat = queryUtility(ICatalog, name='beds_catalog')
+        results = cat.searchResults(bed_type=(None, None))
+        self.assertEqual(len(results), 11)
+        self.browser.getControl("Clear hostel").click()
+        self.assertEqual(len(self.app['hostels']['hall-1']), 0)
+        # Only the bed in hall-x remains in the catalog.
+        results = cat.searchResults(bed_type=(None, None))
+        self.assertEqual(len(results), 1)
+        # We can clear all hostels at the same time.
+        self.browser.open(self.manage_container_path)
+        self.browser.getControl("Clear all hostels").click()
+        results = cat.searchResults(bed_type=(None, None))
+        self.assertEqual(len(results), 0)
+        # Both actions have been logged.
+        logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'hostels.log')
+        logcontent = open(logfile).read()
+        self.assertTrue('INFO - zope.mgr - hostels.browser.HostelManageFormPage'
+                        ' - hall-1 - cleared' in logcontent)
+        self.assertTrue('zope.mgr - hostels.browser.HostelsContainerManagePage'
+                        ' - hostels - all hostels cleared' in logcontent)
