Changeset 1301 for WAeUP_SRP/trunk


Ignore:
Timestamp:
15 Jan 2007, 12:00:30 (18 years ago)
Author:
joachim
Message:

set total correct for reserved beds (in custom)

Location:
WAeUP_SRP/trunk/skins/waeup_accommodation
Files:
2 edited

Legend:

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

    r1298 r1301  
    3737bt_list = []
    3838bt_names =  context.getBedTypeNames()
    39 reserved = pa.uniqueValuesFor('student')
     39res = pa.uniqueValuesFor('student')
     40reserved = [st for st in res if st]
    4041sum_total = 0
    41 sum_free = 0
     42sum_occupied = 0
     43#from Products.zdb import set_trace;set_trace()
    4244for bt in bed_types:
    4345    total = len(pa(bed_type=bt))
    4446    sum_total += total
    45     free = len(pa.searchResults({'bed_type': bt,'student':reserved}))
    46     sum_free += free
     47    occupied = len(pa.searchResults({'bed_type': bt,'student':reserved}))
     48    sum_occupied += occupied
    4749    bt_list.append({'name': bt_names[bt],
    4850                    'total': total,
    49                     'reserved': free,
    50                     'full': free == total,
     51                    'reserved': occupied,
     52                    'full': occupied == total,
    5153                    })
    5254bt_list.append({'name': "All Categories",
    5355                'total': sum_total,
    54                 'reserved': sum_free,
     56                'reserved': sum_occupied,
    5557                })
    5658info['bed_types'] = bt_list
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py

    r1297 r1301  
    3333bt_list = []
    3434bt_names =  context.getBedTypeNames()
    35 all_booked = pa.uniqueValuesFor('student')
     35res = pa.uniqueValuesFor('student')
     36all_booked = [st for st in res if st]
    3637booked_list = []
    3738#from Products.zdb import set_trace;set_trace()
Note: See TracChangeset for help on using the changeset viewer.