예제 #1
0
    def rows(self):
        config = {
            'domain': self.domain,
            'location_id': self.request.GET.get('location_id'),
            'program_id': self.program_id,
            'date': self.request.GET.get('date', None),
            'max_rows': 100
        }

        data = SimplifiedInventoryDataSource(config).get_data()

        for loc_name, loc_data in data:
            yield [loc_name] + [
                loc_data.get(p.product_id, _('No data')) for p in self.products
            ]
예제 #2
0
    def rows(self):
        config = {
            'domain': self.domain,
            'location_id': self.request.GET.get('location_id'),
            'program_id': self.program_id,
            'date': self.request.GET.get('date', None),
            'max_rows': 100
        }

        data = SimplifiedInventoryDataSource(config).get_data()

        for loc_name, loc_data in data:
            row_dict = dict(self.product_dict, **dict(loc_data))
            yield [loc_name] + [
                v if v is not None else _('No data')
                for k, v in sorted(row_dict.items(),
                                   key=lambda (k, v): self.product_names[k])
            ]