Index: /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/__init__.py
===================================================================
--- /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/__init__.py	(revision 15646)
+++ /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/__init__.py	(revision 15646)
@@ -0,0 +1,11 @@
+"""This package contains everything regarding hostels.
+"""
+# Make this a package.
+from waeup.kofa.hostels.container import HostelsContainer
+from waeup.kofa.hostels.hostel import Hostel, Bed
+
+__all__ = [
+    'HostelsContainer',
+    'Hostel',
+    'Bed',
+    ]
Index: /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/browser.py
===================================================================
--- /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/browser.py	(revision 15646)
+++ /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/browser.py	(revision 15646)
@@ -0,0 +1,39 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""UI components for hostels and related components.
+"""
+import grok
+from waeup.kofa.hostels.browser import (
+    HostelAddFormPage, HostelDisplayFormPage, HostelManageFormPage)
+from kofacustom.iuokada.hostels.interfaces import ICustomHostel
+
+class CustomHostelAddFormPage(HostelAddFormPage):
+    """Add-form to add a hostel.
+    """
+    form_fields = grok.AutoFields(ICustomHostel).omit(
+        'beds_reserved', 'hostel_id')
+
+class CustomHostelDisplayFormPage(HostelDisplayFormPage):
+    """ Page to display hostel data
+    """
+    form_fields = grok.AutoFields(ICustomHostel).omit('beds_reserved')
+
+class CustomHostelManageFormPage(HostelManageFormPage):
+    """ View to edit hostel data
+    """
+    form_fields = grok.AutoFields(ICustomHostel).omit('hostel_id', 'beds_reserved')
Index: /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/hostel.py
===================================================================
--- /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/hostel.py	(revision 15646)
+++ /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/hostel.py	(revision 15646)
@@ -0,0 +1,61 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+These are the custom hostels.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.kofa.hostels.hostel import HostelFactory, BedFactory, Hostel, Bed
+from kofacustom.iuokada.hostels.interfaces import ICustomHostel, ICustomBed
+
+class CustomHostel(Hostel):
+    """This is a hostel.
+    """
+    grok.implements(ICustomHostel)
+    grok.provides(ICustomHostel)
+
+CustomHostel = attrs_to_fields(CustomHostel)
+
+class CustomBed(Bed):
+    """This is a bed.
+    """
+    grok.implements(ICustomBed)
+    grok.provides(ICustomBed)
+
+CustomBed = attrs_to_fields(CustomBed)
+
+class CustomHostelFactory(HostelFactory):
+    """A factory for hostels.
+    """
+
+    def __call__(self, *args, **kw):
+        return CustomHostel()
+
+    def getInterfaces(self):
+        return implementedBy(CustomHostel)
+
+class CustomBedFactory(BedFactory):
+    """A factory for beds.
+    """
+
+    def __call__(self, *args, **kw):
+        return CustomBed()
+
+    def getInterfaces(self):
+        return implementedBy(CustomBed)
Index: /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/interfaces.py
===================================================================
--- /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/interfaces.py	(revision 15646)
+++ /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/hostels/interfaces.py	(revision 15646)
@@ -0,0 +1,95 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+from  grok import getSite
+from datetime import datetime
+from zope.component import getUtility
+from zope.catalog.interfaces import ICatalog
+from zope.interface import invariant, Invalid, Attribute, Interface
+from zope import schema
+from waeup.kofa.interfaces import SimpleKofaVocabulary
+from waeup.kofa.hostels.interfaces import IHostel, IBed
+
+from kofacustom.iuokada.interfaces import MessageFactory as _
+
+blocks = SimpleKofaVocabulary(
+    (_('Block 1'),'1'),
+    (_('Block 2'),'2'),
+    (_('Block 3'),'3'),
+    (_('Block 4'),'4'),
+    (_('Block 5'),'5'),
+    (_('Block 6'),'6'),
+    (_('Block 7'),'7'),
+    (_('Block 8'),'8'),
+    (_('Block 9'),'9'),
+    (_('Block 10'),'10'),
+    (_('Block 11'),'11'),
+    (_('Block 12'),'12'),
+    (_('Block 13'),'13'),
+    (_('Block 14'),'14'),
+    (_('Block 15'),'15'),
+    (_('Block 16'),'16'),
+    (_('Block 17'),'17'),
+    (_('Block 18'),'18'),
+    (_('Block 19'),'19'),
+    )
+
+class ICustomHostel(IHostel):
+    """Representation of a hostel.
+    """
+
+    floors_per_block = schema.Int(
+        title = _(u'Flats per Block'),
+        required = True,
+        default = 1,
+        )
+
+    rooms_per_floor = schema.Int(
+        title = _(u'Rooms per Flat'),
+        required = True,
+        default = 2,
+        )
+
+    blocks_for_female = schema.List(
+        title = _(u'Blocks for Female Students'),
+        value_type = schema.Choice(
+            vocabulary = blocks
+            ),
+        defaultFactory=list,
+        )
+
+    blocks_for_male = schema.List(
+        title = _(u'Blocks for Male Students'),
+        value_type = schema.Choice(
+            vocabulary = blocks
+            ),
+        defaultFactory=list,
+        )
+
+ICustomHostel['floors_per_block'].order = IHostel[
+    'floors_per_block'].order
+ICustomHostel['rooms_per_floor'].order = IHostel[
+    'rooms_per_floor'].order
+ICustomHostel['blocks_for_female'].order = IHostel[
+    'blocks_for_female'].order
+ICustomHostel['blocks_for_male'].order = IHostel[
+    'blocks_for_male'].order
+
+class ICustomBed(IBed):
+    """Representation of a bed.
+    """
+
