Projet

Général

Profil

0002-visualization-format-axis-members-before-JSON-serial.patch

Benjamin Dauvergne, 13 janvier 2020 15:15

Télécharger (1,42 ko)

Voir les différences:

Subject: [PATCH 2/3] visualization: format axis members before JSON
 serialization (#38908)

 bijoe/visualization/utils.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
bijoe/visualization/utils.py
14 14
# You should have received a copy of the GNU Affero General Public License
15 15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16

  
17
from __future__ import unicode_literals
18

  
17 19
import re
18 20
import json
19 21
import hashlib
......
295 297

  
296 298
        if len(self.drilldown) == 2:
297 299
            (x_axis, y_axis), grid = self.table_2d()
298
            cells = (([x.label, y.label], cell_value(grid[(x.id, y.id)])) for x in x_axis for y in y_axis)
300
            cells = ((['%s' % x.label, '%s' % y.label], cell_value(grid[(x.id, y.id)])) for x in x_axis for y in y_axis)
299 301
        elif len(self.drilldown) == 1:
300 302
            axis, grid = self.table_1d()
301
            cells = (([x.label], cell_value(grid[x.id])) for x in axis)
303
            cells = ((['%s' % x.label], cell_value(grid[x.id])) for x in axis)
302 304
        else:
303 305
            raise NotImplementedError
304 306

  
305
-