def _get_aggregate_row(self): queryset = self.admin_view.list_queryset._clone() obj = queryset.aggregate(*[AGGREGATE_METHODS[method](field_name) for field_name, method in self.aggregate_fields.items() if method in AGGREGATE_METHODS]) row = ResultRow() row['is_display_first'] = False row.cells = [self._get_field_aggregate(field_name, obj, row) for field_name in self.admin_view.list_display] row.css_class = 'info aggregate' return row
def _get_aggregate_row(self): queryset = self.admin_view.list_queryset._clone() obj = queryset.aggregate(*[AGGREGATE_METHODS[method](field_name) for field_name, method in list(self.aggregate_fields.items()) if method in AGGREGATE_METHODS]) row = ResultRow() row['is_display_first'] = False row.cells = [self._get_field_aggregate(field_name, obj, row) for field_name in self.admin_view.list_display] row.css_class = 'info aggregate' return row
def _get_aggregate_row(self): if self.aggregate_queryset_all: queryset = self.admin_view.list_queryset._clone() else: queryset = self.admin_view.result_list._clone() row = ResultRow() row['is_display_first'] = False row.cells = [self._get_field_aggregate(field_name, queryset, row) for field_name in self.admin_view.list_display] row.css_class = 'info aggregate' return row
def get_data(self): row = ResultRow() item1 = ResultItem("pin", row) item1.text = 1 row.cells.append(item1) item2 = ResultItem("EName", row) item2.text = 2 row.cells.append(item2) item3 = ResultItem("Card", row) item3.text = 2 row.cells.append(item3) return [row, row, row, row, row]