@property
    def rows(self):
        del_data = []
        if 'data_config' in self.config:
            data_config = self.config['data_config']
            delivered = data_config.delivery_data_total.get('received', 0)
            not_delivered = data_config.delivery_data_total.get('not_received', 0)
            del_data.append(GroupSummary(
                title=SupplyPointStatusTypes.DELIVERY_FACILITY,
                responded=delivered + not_delivered,
                on_time=delivered + not_delivered,
                complete=delivered,
                total=data_config.delivery_data_total.get('total', 0)
            ))
            return del_data

        if self.config['org_summary']:
            try:
                data = GroupSummary.objects.filter(
                    title=SupplyPointStatusTypes.DELIVERY_FACILITY,
                    org_summary__in=self.config['org_summary']
                ).aggregate(Avg('responded'), Avg('on_time'), Avg('complete'), Max('total'))

                del_data.append(GroupSummary(
                    title=SupplyPointStatusTypes.DELIVERY_FACILITY,
                    responded=data['responded__avg'],
                    on_time=data['on_time__avg'],
                    complete=data['complete__avg'],
                    total=data['total__max']
                ))
            except GroupSummary.DoesNotExist:
                return del_data
        return del_data
dataset/ETHPy150Open dimagi/commcare-hq/custom/ilsgateway/tanzania/reports/mixins.py/DeliverySubmissionData.rows/original