Changeset 6975 for main


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.

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

Legend:

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

    r6974 r6975  
    250250                return
    251251        if len(switched):
     252            #import pdb; pdb.set_trace()
    252253            self.flash('Successfully switched: %s' % ', '.join(switched))
    253254            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
  • 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
  • main/waeup.sirp/trunk/src/waeup/sirp/hostels/interfaces.py

    r6974 r6975  
    5454        )
    5555
     56    reserved = schema.List(
     57        title = u'Reserved Beds',
     58        value_type = schema.TextLine(
     59            title = u'Bed',
     60            default = u'',
     61            required = False,
     62        ),
     63        required = True,
     64        readonly = False,
     65        default = [],
     66        )
     67
    5668    blocks_for_female = schema.List(
    5769        title = u'Blocks for Female Students',
     
    101113        required = True,
    102114        default = u'regular',
    103         )
    104 
    105     reserved = schema.TextLine(
    106         title = u'Reserved Beds',
    107         required = False,
    108         readonly = True,
    109115        )
    110116
Note: See TracChangeset for help on using the changeset viewer.