mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_shape=arrayfirst, closes #287
This commit is contained in:
parent
b463f60158
commit
276913b748
3 changed files with 19 additions and 1 deletions
|
|
@ -185,7 +185,9 @@ class BaseView(RenderMixin):
|
|||
|
||||
# Deal with the _shape option
|
||||
shape = request.args.get("_shape", "arrays")
|
||||
if shape in ("objects", "object", "array"):
|
||||
if shape == "arrayfirst":
|
||||
data = [row[0] for row in data["rows"]]
|
||||
elif shape in ("objects", "object", "array"):
|
||||
columns = data.get("columns")
|
||||
rows = data.get("rows")
|
||||
if rows and columns:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue