_header=off option for CSV export, closes #1133

This commit is contained in:
Simon Willison 2020-12-10 15:28:44 -08:00
commit 2c0aca4887
3 changed files with 26 additions and 1 deletions

View file

@ -307,7 +307,8 @@ class DataView(BaseView):
if not first:
data, _, _ = await self.data(request, database, hash, **kwargs)
if first:
await writer.writerow(headings)
if request.args.get("_header") != "off":
await writer.writerow(headings)
first = False
next = data.get("next")
for row in data["rows"]: