mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Backport of CSV labels fix from #2214
This commit is contained in:
parent
5800eaeb5b
commit
324090919d
2 changed files with 41 additions and 3 deletions
|
|
@ -308,9 +308,11 @@ class DataView(BaseView):
|
|||
if cell is None:
|
||||
new_row.extend(("", ""))
|
||||
else:
|
||||
assert isinstance(cell, dict)
|
||||
new_row.append(cell["value"])
|
||||
new_row.append(cell["label"])
|
||||
if not isinstance(cell, dict):
|
||||
new_row.extend((cell, ""))
|
||||
else:
|
||||
new_row.append(cell["value"])
|
||||
new_row.append(cell["label"])
|
||||
else:
|
||||
new_row.append(cell)
|
||||
await writer.writerow(new_row)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue