issues
2 rows where "created_at" is on date 2021-04-28 and repo = 107914493 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: updated_at (date), closed_at (date)
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at ▲ | closed_at | author_association | pull_request | body | repo | type | active_lock_reason | performed_via_github_app | reactions | draft | state_reason |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
870125126 | MDU6SXNzdWU4NzAxMjUxMjY= | 1310 | I'm creating a plugin to export a spreadsheet file (.ods or .xlsx) | ColinMaudry 3747136 | closed | 0 | 2 | 2021-04-28T16:20:11Z | 2021-04-30T07:26:11Z | 2021-04-30T06:58:46Z | NONE | Hi, I have started developing a plugin to export records as a spreadsheet file. It could be ods or xlsx, whatever is easier. I have spotted the following packages:
This is the code I have so far, I test it with the ```python from datasette import hookimpl from datasette.utils.asgi import Response import odswriter as ods def render_spreadsheet(rows): with ods.writer(open("test.ods","wb")) as odsfile: for row in rows: odsfile.writerow(["String", "ABCDEF123456", "123456"]) return Response(odsfile, content_type="application/vnd.oasis.opendocument.spreadsheet", status=200) @hookimpl def register_output_renderer(): return {"extension": "ods", "render": render_spreadsheet} ``` I get the following error: ``` Traceback (most recent call last): File "/home/colin/.local/lib/python3.8/site-packages/datasette/app.py", line 1128, in route_path await response.asgi_send(send) File "/home/colin/.local/lib/python3.8/site-packages/datasette/utils/asgi.py", line 339, in asgi_send body = body.encode("utf-8") AttributeError: 'ODSWriter' object has no attribute 'encode' ERROR: Exception in ASGI application Traceback (most recent call last): File "/home/colin/.local/lib/python3.8/site-packages/datasette/app.py", line 1128, in route_path await response.asgi_send(send) File "/home/colin/.local/lib/python3.8/site-packages/datasette/utils/asgi.py", line 339, in asgi_send body = body.encode("utf-8") AttributeError: 'ODSWriter' object has no attribute 'encode' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/colin/.local/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 396, in run_asgi result = await app(self.scope, self.receive, self.send) File "/home/colin/.local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call return await self.app(scope, receive, send) File "/home/colin/.local/lib/python3.8/site-packages/datasette/utils/asgi.py", line 161, in call await self.app(scope, receive, send) File "/home/colin/.local/lib/python3.8/site-packages/datasette/tracer.py", line 75, in call await self.app(scope, receive, send) File "/home/colin/.local/lib/python3.8/site-packages/asgi_csrf.py", line 107, in app_wrapped_with_csrf await app(scope, receive, wrapped_send) File "/home/colin/.local/lib/python3.8/site-packages/datasette/app.py", line 1086, in call return await self.route_path(scope, receive, send, path) File "/home/colin/.local/lib/python3.8/site-packages/datasette/app.py", line 1133, in route_path return await self.handle_500(request, send, exception) File "/home/colin/.local/lib/python3.8/site-packages/datasette/app.py", line 1267, in handle_500 await asgi_send_html( File "/home/colin/.local/lib/python3.8/site-packages/datasette/utils/asgi.py", line 217, in asgi_send_html await asgi_send( File "/home/colin/.local/lib/python3.8/site-packages/datasette/utils/asgi.py", line 237, in asgi_send await asgi_start(send, status, headers, content_type) File "/home/colin/.local/lib/python3.8/site-packages/datasette/utils/asgi.py", line 246, in asgi_start await send( File "/home/colin/.local/lib/python3.8/site-packages/asgi_csrf.py", line 103, in wrapped_send await send(event) File "/home/colin/.local/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 482, in send raise RuntimeError(msg % message_type) RuntimeError: Expected ASGI message 'http.response.body', but got 'http.response.start'. ``` I tried with
However, the
How would you suggest me to proceed to have my ods file downloaded? |
datasette 107914493 | issue | { "url": "https://api.github.com/repos/simonw/datasette/issues/1310/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | ||||||
870227815 | MDExOlB1bGxSZXF1ZXN0NjI1NDU3NTc5 | 1311 | Bump black from 20.8b1 to 21.4b1 | dependabot-preview[bot] 27856297 | closed | 0 | 2 | 2021-04-28T18:25:58Z | 2021-04-29T13:58:11Z | 2021-04-29T13:58:09Z | CONTRIBUTOR | simonw/datasette/pulls/1311 | Bumps black from 20.8b1 to 21.4b1. Release notesSourced from black's releases.
... (truncated) ChangelogSourced from black's changelog.
... (truncated) Commits
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting Dependabot commands and optionsYou can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) |
datasette 107914493 | pull | { "url": "https://api.github.com/repos/simonw/datasette/issues/1311/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
0 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issues] ( [id] INTEGER PRIMARY KEY, [node_id] TEXT, [number] INTEGER, [title] TEXT, [user] INTEGER REFERENCES [users]([id]), [state] TEXT, [locked] INTEGER, [assignee] INTEGER REFERENCES [users]([id]), [milestone] INTEGER REFERENCES [milestones]([id]), [comments] INTEGER, [created_at] TEXT, [updated_at] TEXT, [closed_at] TEXT, [author_association] TEXT, [pull_request] TEXT, [body] TEXT, [repo] INTEGER REFERENCES [repos]([id]), [type] TEXT , [active_lock_reason] TEXT, [performed_via_github_app] TEXT, [reactions] TEXT, [draft] INTEGER, [state_reason] TEXT); CREATE INDEX [idx_issues_repo] ON [issues] ([repo]); CREATE INDEX [idx_issues_milestone] ON [issues] ([milestone]); CREATE INDEX [idx_issues_assignee] ON [issues] ([assignee]); CREATE INDEX [idx_issues_user] ON [issues] ([user]);