Changeset 411 for WAeUP_SRP/trunk
- Timestamp:
- 23 Aug 2006, 20:19:01 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Accommodation.py
r407 r411 33 33 h = hall.getContent() 34 34 reserved = [int(r) for r in h.reserved_rooms.split()] 35 print h.which_sex 36 sex = 'male' 37 if h.which_sex: 38 sex = 'female' 35 39 for block in range(1,int(h.nr_of_blocks)): 36 40 for floor in range(1,int(h.nr_of_floors)): … … 48 52 elif bed in h.beds_for_final: 49 53 bt = 'fi' 50 print bt 51 freelist.addRecord(bed = '%s_%d_%s' % (h.getId(),room_nr,bed), 52 bed_type = bt) 54 bt = "%(sex)s_%(bt)s" % vars() 55 uid = '%s_%d_%s' % (hall.getId(),room_nr,bed) 56 print bt,uid 57 freelist.addRecord(bed = uid) 58 try: 59 freelist.modifyRecord(uid, bed = bed, bed_type = bt) 60 except ValueError,e: 61 freelist.deleteRecord(uid) 62 53 63 return self.accommodation.academics_contents() 54 64 -
WAeUP_SRP/trunk/WAeUPTables.py
r404 r411 76 76 77 77 InitializeClass(AccommodationTable) 78 79 class AccomodationTable(WAeUPTable): 80 81 meta_type = 'WAeUP Accomodation Tool' 82 83 def __init__(self): 84 WAeUPTable.__init__(self, 'portal_accommodation') 85 86 def addRecord(self, **data): 87 # The uid is the same as "bed". 88 uid = data['bed'] 89 self.catalog_object(dict2ob(data), uid=uid) 90 return uid 91 92 93 InitializeClass(AccomodationTable)
Note: See TracChangeset for help on using the changeset viewer.