Changeset 1301 for WAeUP_SRP/trunk
- Timestamp:
- 15 Jan 2007, 12:00:30 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_accommodation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoFolderInfo.py
r1298 r1301 37 37 bt_list = [] 38 38 bt_names = context.getBedTypeNames() 39 reserved = pa.uniqueValuesFor('student') 39 res = pa.uniqueValuesFor('student') 40 reserved = [st for st in res if st] 40 41 sum_total = 0 41 sum_free = 0 42 sum_occupied = 0 43 #from Products.zdb import set_trace;set_trace() 42 44 for bt in bed_types: 43 45 total = len(pa(bed_type=bt)) 44 46 sum_total += total 45 free= len(pa.searchResults({'bed_type': bt,'student':reserved}))46 sum_ free += free47 occupied = len(pa.searchResults({'bed_type': bt,'student':reserved})) 48 sum_occupied += occupied 47 49 bt_list.append({'name': bt_names[bt], 48 50 'total': total, 49 'reserved': free,50 'full': free== total,51 'reserved': occupied, 52 'full': occupied == total, 51 53 }) 52 54 bt_list.append({'name': "All Categories", 53 55 'total': sum_total, 54 'reserved': sum_ free,56 'reserved': sum_occupied, 55 57 }) 56 58 info['bed_types'] = bt_list -
WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py
r1297 r1301 33 33 bt_list = [] 34 34 bt_names = context.getBedTypeNames() 35 all_booked = pa.uniqueValuesFor('student') 35 res = pa.uniqueValuesFor('student') 36 all_booked = [st for st in res if st] 36 37 booked_list = [] 37 38 #from Products.zdb import set_trace;set_trace()
Note: See TracChangeset for help on using the changeset viewer.