예제 #1
0
def _get_total_by_property_type(rental_contracts):
    def make_data(row):
        return {row: sum_by('rental_amount', grouped_data[row])}
    grouped_data = group_by('property_type', rental_contracts)
    return list(map(make_data, grouped_data.keys()))
예제 #2
0
def _get_total_by_month(key, data):
    def make_data(row):
        return {row: sum_by(key, grouped_data[row])}

    grouped_data = group_by('month', data)
    return list(map(make_data, grouped_data.keys()))