Ignore:
Timestamp:
19 Nov 2015, 11:34:48 (9 years ago)
Author:
Henrik Bettermann
Message:

Add bed statistics view components.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/hostels/utils.py

    r13483 r13484  
    3939            'regular_female_fi',
    4040            'regular_female_all',
     41            'regular_female_reserved',
    4142            'regular_male_fr',
    4243            'regular_male_re',
    4344            'regular_male_fi',
    44             'regular_male_all',)
     45            'regular_male_all',
     46            'regular_male_reserved',)
    4547        for bed_type in bed_types:
    46             no = cat.searchResults(
     48            free = cat.searchResults(
    4749                bed_type=(bed_type, bed_type),
    4850                owner=(NOT_OCCUPIED, NOT_OCCUPIED))
    4951            all = cat.searchResults(
    5052                bed_type=(bed_type, bed_type))
    51             stats[bed_type] = (len(no), len(all))
     53            free = len(free)
     54            total = len(all)
     55            occ = total - free
     56            stats[bed_type] = (occ, free, total)
    5257        return stats
Note: See TracChangeset for help on using the changeset viewer.