'Data representation of the datasource sent to the frontend'

@property
def data(self):

    order_by_choices = []
    for s in sorted(self.column_names):
        order_by_choices.append((json.dumps([s, True]), (s + '    [asc]')))
        order_by_choices.append((json.dumps([s, False]), (s + '    [desc]')))
    verbose_map = {o.metric_name: (o.verbose_name or o.metric_name) for o in self.metrics}
    verbose_map.update({o.column_name: (o.verbose_name or o.column_name) for o in self.columns})
    return {'all_cols': utils.choicify(self.column_names), 'column_formats': self.column_formats, 'edit_url': self.url, 'filter_select': self.filter_select_enabled, 'filterable_cols': utils.choicify(self.filterable_column_names), 'gb_cols': utils.choicify(self.groupby_column_names), 'id': self.id, 'metrics_combo': self.metrics_combo, 'name': self.name, 'order_by_choices': order_by_choices, 'type': self.type, 'metrics': [o.data for o in self.metrics], 'columns': [o.data for o in self.columns], 'verbose_map': verbose_map}
