Changeset 1138 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
23 Dec 2006, 12:37:21 (18 years ago)
Author:
joachim
Message:

add a total (in custom)

File:
1 edited

Legend:

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

    r913 r1138  
    3838bt_names =  context.getBedTypeNames()
    3939reserved = pa.uniqueValuesFor('student')
     40sum_total = 0
     41sum_free = 0
    4042for bt in bed_types:
    4143    total = len(pa(bed_type=bt))
     44    sum_total += total
    4245    free = len(pa.searchResults({'bed_type': bt,'student':reserved}))
     46    sum_free += free
    4347    bt_list.append({'name': bt_names[bt],
    4448                    'total': total,
    4549                    'reserved': free,
    4650                    })
     51bt_list.append({'name': "Total",
     52                'total': sum_total,
     53                'reserved': sum_free,
     54                })
    4755info['bed_types'] = bt_list
    4856reserved = pa.uniqueValuesFor('student')
Note: See TracChangeset for help on using the changeset viewer.