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

Use List field for 'reserved' attribute and fill or remove list items when reserving or releasing a bed. The 'reserved' field should be omitted in the manage form. When clearing a hostel the reserved bed configuration remains and can be used when refilling the hostel in the following session.

File:
1 edited

Legend:

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

    r6974 r6975  
    122122        beds_for_returning = getattr(self,'beds_for_returning',[])
    123123        beds_for_final = getattr(self,'beds_for_final',[])
     124        hostel = self.__parent__
     125        bed_string = u'%s_%s_%s ' % (block, room_nr, bed)
    124126        if bt == 'reserved':
    125127            bt = 'all'
     
    133135                bt = 're'
    134136            bt = u'%s_%s_%s' % (sh, sex, bt)
     137            hostel.reserved.remove(bed_string)
    135138        else:
    136139            bt = u'%s_%s_reserved' % (sh, sex)
     140            hostel.reserved.append(bed_string)
    137141        self.bed_type = bt
    138142        return
Note: See TracChangeset for help on using the changeset viewer.