Changeset 3007
- Timestamp:
- 11 Jan 2008, 07:02:36 (17 years ago)
- Location:
- WAeUP_SRP/base/skins/waeup_accommodation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_accommodation/getBedStatistics.py
r1438 r3007 15 15 bt_names = context.getBedTypeNames() 16 16 res = pa.uniqueValuesFor('student') 17 reserved = [st for st in res if st]17 occupied_types = [st for st in res if st and st != 'not_occupied'] 18 18 sum_total = 0 19 19 sum_occupied = 0 … … 23 23 total = len(pa(bed_type=bt)) 24 24 sum_total += total 25 occupied = len(pa.searchResults({'bed_type': bt,'student': reserved}))25 occupied = len(pa.searchResults({'bed_type': bt,'student':occupied_types})) 26 26 sum_occupied += occupied 27 27 bt_list.append({'name': bt_names[bt], 28 28 'total': total, 29 ' reserved': occupied,29 'occupied': occupied, 30 30 'full': occupied == total, 31 31 }) 32 32 bt_list.append({'name': "All Categories", 33 33 'total': sum_total, 34 ' reserved': sum_occupied,34 'occupied': sum_occupied, 35 35 }) 36 36 info['bed_types'] = bt_list 37 reserved = pa.uniqueValuesFor('student') 38 res_list = [] 39 if reserved > 1: 40 for st in reserved: 41 if st: 42 res = pa(student=st) 43 res_list.append({'student': st, 'bed': res[0].bed }) 44 info['reserved'] = res_list 37 38 #reserved = pa.uniqueValuesFor('student') 39 #res_list = [] 40 #if reserved > 1: 41 # for st in reserved: 42 # if st: 43 # res = pa(student=st) 44 # res_list.append({'student': st, 'bed': res[0].bed }) 45 #info['reserved'] = res_list 46 45 47 return info -
WAeUP_SRP/base/skins/waeup_accommodation/statistics_bed_view.pt
r1438 r3007 18 18 <td tal:content="bt/name" /> 19 19 <td tal:content="bt/total" /> 20 <td tal:content="bt/ reserved" />20 <td tal:content="bt/occupied" /> 21 21 <td tal:condition="bt/full|nothing"> 22 22 <strong>Fully booked</strong>
Note: See TracChangeset for help on using the changeset viewer.