(self)
return context
Don't override.
            Override the properties headers and rows instead of this.
Don't override.
            Override the properties headers and rows instead of this.
Don t override . Override the properties headers and rows instead of this .
def report_context(self):
        """
            Don't override.
            Override the properties headers and rows instead of this.
        """
        headers = self.headers # not all headers have been memoized
        assert isinstance(headers, (DataTablesHeader, list))
        if isinstance(headers, list):
            raise DeprecationWarning("Property 'headers' should be a DataTablesHeader object, not a list.")

        if self.ajax_pagination and self.is_rendered_as_email:
            rows = self.get_all_rows
            charts = []
        elif self.ajax_pagination or self.needs_filters:
            rows = []
            charts = []
        else:
            rows = list(self.rows)
            charts = list(self.charts)

        if self.total_row is not None:
            self.total_row = list(self.total_row)
        if self.statistics_rows is not None:
            self.statistics_rows = list(self.statistics_rows)

        pagination_spec = dict(is_on=self.ajax_pagination and not self.is_rendered_as_email)
        if self.ajax_pagination:
            shared_params = list(self.shared_pagination_GET_params)
            pagination_spec.update(
                params=shared_params,
                source=self.pagination_source,
                filter=False
            )
        if self.disable_pagination:
            pagination_spec['hide'] = True

        left_col = dict(is_fixed=self.fix_left_col)
        if self.fix_left_col:
            spec = dict(self.fixed_cols_spec)
            left_col.update(fixed=spec)

        context = dict(
            report_table=dict(
                headers=headers,
                rows=rows,
                total_row=self.total_row,
                statistics_rows=self.statistics_rows,
                default_rows=self.default_rows,
                start_at_row=self.start_at_row,
                show_all_rows=self.show_all_rows,
                pagination=pagination_spec,
                left_col=left_col,
                datatables=self.use_datatables,
                bad_request_error_text=self.bad_request_error_text,
                sortable=self.sortable,
            ),
            charts=charts,
            chart_span=CHART_SPAN_MAP[self.charts_per_row]
        )
        report_table = context['report_table']
        pagination_on = report_table['pagination']['is_on']
        context.update({
            'report_table_js_options': {
                'datatables': report_table['datatables'],
                'default_rows': report_table['default_rows'] or 10,
                'start_at_row': report_table['start_at_row'] or 0,
                'show_all_rows': report_table['show_all_rows'],
                'sortable': report_table['sortable'],
                'headers': {
                    'render_aoColumns': report_table['headers'].render_aoColumns,
                    'auto_width': report_table['headers'].auto_width,
                    'custom_sort': report_table['headers'].custom_sort,
                },
                'bad_request_error_text': report_table['bad_request_error_text'],
                'pagination': {
                    'hide': getattr(report_table['pagination'], 'hide', False),
                    'is_on': pagination_on,
                    'source': report_table['pagination']['source'] if pagination_on else None,
                    'params': report_table['pagination']['params'] if pagination_on else None,
                },
                'left_col': {
                    'is_fixed': report_table['left_col']['is_fixed'],
                    'fixed': {
                        'num': report_table['left_col']['fixed']['num'],
                        'width': report_table['left_col']['fixed']['width'],
                    } if report_table['left_col']['is_fixed'] else {},
                },
            },
        })
        for provider_function in self.extra_context_providers:
            context.update(provider_function(self))
        return context
def report_context ( self ) : headers = self . headers # not all headers have been memoized assert isinstance ( headers , ( DataTablesHeader , list ) ) if isinstance ( headers , list ) : raise DeprecationWarning ( "Property 'headers' should be a DataTablesHeader object, not a list." ) if self . ajax_pagination and self . is_rendered_as_email : rows = self . get_all_rows charts = [ ] elif self . ajax_pagination or self . needs_filters : rows = [ ] charts = [ ] else : rows = list ( self . rows ) charts = list ( self . charts ) if self . total_row is not None : self . total_row = list ( self . total_row ) if self . statistics_rows is not None : self . statistics_rows = list ( self . statistics_rows ) pagination_spec = dict ( is_on = self . ajax_pagination and not self . is_rendered_as_email ) if self . ajax_pagination : shared_params = list ( self . shared_pagination_GET_params ) pagination_spec . update ( params = shared_params , source = self . pagination_source , filter = False ) if self . disable_pagination : pagination_spec [ 'hide' ] = True left_col = dict ( is_fixed = self . fix_left_col ) if self . fix_left_col : spec = dict ( self . fixed_cols_spec ) left_col . update ( fixed = spec ) context = dict ( report_table = dict ( headers = headers , rows = rows , total_row = self . total_row , statistics_rows = self . statistics_rows , default_rows = self . default_rows , start_at_row = self . start_at_row , show_all_rows = self . show_all_rows , pagination = pagination_spec , left_col = left_col , datatables = self . use_datatables , bad_request_error_text = self . bad_request_error_text , sortable = self . sortable , ) , charts = charts , chart_span = CHART_SPAN_MAP [ self . charts_per_row ] ) report_table = context [ 'report_table' ] pagination_on = report_table [ 'pagination' ] [ 'is_on' ] context . update ( { 'report_table_js_options' : { 'datatables' : report_table [ 'datatables' ] , 'default_rows' : report_table [ 'default_rows' ] or 10 , 'start_at_row' : report_table [ 'start_at_row' ] or 0 , 'show_all_rows' : report_table [ 'show_all_rows' ] , 'sortable' : report_table [ 'sortable' ] , 'headers' : { 'render_aoColumns' : report_table [ 'headers' ] . render_aoColumns , 'auto_width' : report_table [ 'headers' ] . auto_width , 'custom_sort' : report_table [ 'headers' ] . custom_sort , } , 'bad_request_error_text' : report_table [ 'bad_request_error_text' ] , 'pagination' : { 'hide' : getattr ( report_table [ 'pagination' ] , 'hide' , False ) , 'is_on' : pagination_on , 'source' : report_table [ 'pagination' ] [ 'source' ] if pagination_on else None , 'params' : report_table [ 'pagination' ] [ 'params' ] if pagination_on else None , } , 'left_col' : { 'is_fixed' : report_table [ 'left_col' ] [ 'is_fixed' ] , 'fixed' : { 'num' : report_table [ 'left_col' ] [ 'fixed' ] [ 'num' ] , 'width' : report_table [ 'left_col' ] [ 'fixed' ] [ 'width' ] , } if report_table [ 'left_col' ] [ 'is_fixed' ] else { } , } , } , } ) for provider_function in self . extra_context_providers : context . update ( provider_function ( self ) ) return context