Example #1
0
    def rows(self):
        formatter = DataFormatter(TableDataFormat(self.columns, no_value=self.no_value))
        rows = list(formatter.format(self.data, keys=self.keys, group_by=self.group_by))

        #Months are displayed in chronological order
        if 'month' in self.group_by:
            from custom.intrahealth.reports import get_localized_months
            return sorted(rows, key=lambda row: get_localized_months().index(row[0]))

        return rows
Example #2
0
    def rows(self):
        formatter = DataFormatter(TableDataFormat(self.columns, no_value=self.no_value))
        rows = list(formatter.format(self.data, keys=self.keys, group_by=self.group_by))

        #Months are displayed in chronological order
        if 'month' in self.group_by:
            from custom.intrahealth.reports import get_localized_months
            return sorted(rows, key=lambda row: get_localized_months().index(row[0]))

        return rows