Index: /WAeUP_SRP/trunk/Accommodation.py
===================================================================
--- /WAeUP_SRP/trunk/Accommodation.py	(revision 410)
+++ /WAeUP_SRP/trunk/Accommodation.py	(revision 411)
@@ -33,4 +33,8 @@
             h = hall.getContent()
             reserved = [int(r) for r in h.reserved_rooms.split()]
+            print h.which_sex
+            sex = 'male'
+            if h.which_sex:
+                sex = 'female'
             for block in range(1,int(h.nr_of_blocks)):
                 for floor in range(1,int(h.nr_of_floors)):
@@ -48,7 +52,13 @@
                             elif bed in h.beds_for_final:
                                 bt = 'fi'
-                            print bt
-                            freelist.addRecord(bed = '%s_%d_%s' % (h.getId(),room_nr,bed),
-                                               bed_type = bt)
+                            bt = "%(sex)s_%(bt)s" % vars()  
+                            uid = '%s_%d_%s' % (hall.getId(),room_nr,bed)
+                            print bt,uid
+                            freelist.addRecord(bed = uid)
+                            try:
+                                freelist.modifyRecord(uid, bed = bed, bed_type = bt)
+                            except ValueError,e:
+                                freelist.deleteRecord(uid)
+                    
         return self.accommodation.academics_contents()
 
Index: /WAeUP_SRP/trunk/WAeUPTables.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPTables.py	(revision 410)
+++ /WAeUP_SRP/trunk/WAeUPTables.py	(revision 411)
@@ -76,2 +76,18 @@
 
 InitializeClass(AccommodationTable)
+
+class AccomodationTable(WAeUPTable):
+    
+    meta_type = 'WAeUP Accomodation Tool'
+    
+    def __init__(self):
+        WAeUPTable.__init__(self, 'portal_accommodation')
+
+    def addRecord(self, **data):
+        # The uid is the same as "bed".
+        uid = data['bed']
+        self.catalog_object(dict2ob(data), uid=uid)
+        return uid
+
+
+InitializeClass(AccomodationTable)
