From dcc888f25cee5870f20afea63b5c069445fe6d28 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 13 Jan 2020 15:11:15 +0100 Subject: [PATCH 2/3] visualization: format axis members before JSON serialization (#38908) --- bijoe/visualization/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bijoe/visualization/utils.py b/bijoe/visualization/utils.py index 034b141..97b5c18 100644 --- a/bijoe/visualization/utils.py +++ b/bijoe/visualization/utils.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from __future__ import unicode_literals + import re import json import hashlib @@ -295,10 +297,10 @@ class Visualization(object): if len(self.drilldown) == 2: (x_axis, y_axis), grid = self.table_2d() - cells = (([x.label, y.label], cell_value(grid[(x.id, y.id)])) for x in x_axis for y in y_axis) + cells = ((['%s' % x.label, '%s' % y.label], cell_value(grid[(x.id, y.id)])) for x in x_axis for y in y_axis) elif len(self.drilldown) == 1: axis, grid = self.table_1d() - cells = (([x.label], cell_value(grid[x.id])) for x in axis) + cells = ((['%s' % x.label], cell_value(grid[x.id])) for x in axis) else: raise NotImplementedError -- 2.24.0