Changeset 6976


Ignore:
Timestamp:
31 Oct 2011, 10:53:17 (13 years ago)
Author:
Henrik Bettermann
Message:

Consider bed_reserved attribute when filling up an (old) hostel.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/hostels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/hostels/hostel.py

    r6975 r6976  
    5757        beds_for_final = getattr(self,'beds_for_final',[])
    5858        beds_for_all = getattr(self,'beds_for_all',[])
    59         beds_reserved = [] #temporarily empty
     59        beds_reserved = getattr(self,'beds_reserved',[])
    6060        all_blocks = blocks_for_female + blocks_for_male
    6161        all_beds = (beds_for_pre + beds_for_fresh +
    6262            beds_for_returning + beds_for_final + beds_for_all)
    63         #import pdb;pdb.set_trace()
    6463        for block in all_blocks:
    6564            sex = 'male'
     
    7170                        room_nr = floor*100 + room
    7271                        bt = 'all'
    73                         if (block,room_nr) in beds_reserved:
     72                        if '%s_%s_%s' % (block,room_nr,bed) in beds_reserved:
    7473                            bt = "reserved"
    7574                        elif bed in beds_for_fresh:
     
    123122        beds_for_final = getattr(self,'beds_for_final',[])
    124123        hostel = self.__parent__
    125         bed_string = u'%s_%s_%s ' % (block, room_nr, bed)
     124        bed_string = u'%s_%s_%s' % (block, room_nr, bed)
    126125        if bt == 'reserved':
    127126            bt = 'all'
     
    135134                bt = 're'
    136135            bt = u'%s_%s_%s' % (sh, sex, bt)
    137             hostel.reserved.remove(bed_string)
     136            hostel.beds_reserved.remove(bed_string)
    138137        else:
    139138            bt = u'%s_%s_reserved' % (sh, sex)
    140             hostel.reserved.append(bed_string)
     139            hostel.beds_reserved.append(bed_string)
    141140        self.bed_type = bt
    142141        return
  • main/waeup.sirp/trunk/src/waeup/sirp/hostels/interfaces.py

    r6975 r6976  
    5454        )
    5555
    56     reserved = schema.List(
     56    beds_reserved = schema.List(
    5757        title = u'Reserved Beds',
    5858        value_type = schema.TextLine(
    59             title = u'Bed',
    6059            default = u'',
    6160            required = False,
Note: See TracChangeset for help on using the changeset viewer.