From 2565d623af6222f3ed1c630f753b5f95ad749d49 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 1 May 2018 10:40:33 -0700 Subject: [PATCH] ?_shape=array experimental feature --- datasette/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datasette/app.py b/datasette/app.py index 0b73d0e1..30f0d7a1 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -254,7 +254,7 @@ class BaseView(RenderMixin): ) # Deal with the _shape option shape = request.args.get('_shape', 'lists') - if shape in ('objects', 'object'): + if shape in ('objects', 'object', 'array'): columns = data.get('columns') rows = data.get('rows') if rows and columns: @@ -283,6 +283,8 @@ class BaseView(RenderMixin): 'database': name, 'database_hash': hash, } + if shape == 'array': + data = data['rows'] headers = {} if self.ds.cors: