mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_shape=array experimental feature
This commit is contained in:
parent
aa954382c3
commit
2565d623af
1 changed files with 3 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue