Ignore:
Timestamp:
11 Oct 2006, 08:51:55 (18 years ago)
Author:
joachim
Message:

some improvements to accommodation views

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoFolderInfo.py

    r649 r654  
    3939bt_list = []
    4040bt_names =  context.getBedTypeNames()
     41reserved = pa.uniqueValuesFor('student')
    4142for bt in bed_types:
    42     res = pa(bed_type=bt)
    43     bt_list.append({'name': bt_names[bt], 'count': len(res)})
     43    total = len(pa(bed_type=bt))
     44    free = len(pa.searchResults({'bed_type': bt,'student':reserved}))
     45    bt_list.append({'name': bt_names[bt],
     46                    'total': total,
     47                    'reserved': free,
     48                    })
    4449info['bed_types'] = bt_list
    4550reserved = pa.uniqueValuesFor('student')
Note: See TracChangeset for help on using the changeset viewer.