issue_comments
16 rows where issue = 517451234 and user = 9599 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- ?_col= and ?_nocol= support for toggling columns on table view · 16 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
849309330 | https://github.com/simonw/datasette/issues/615#issuecomment-849309330 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0OTMwOTMzMA== | simonw 9599 | 2021-05-27T04:26:10Z | 2021-05-27T04:26:10Z | OWNER | Demos:
Also try the column cog menu on that page. Documentation: https://docs.datasette.io/en/latest/json_api.html#special-table-arguments |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846592583 | https://github.com/simonw/datasette/issues/615#issuecomment-846592583 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjU5MjU4Mw== | simonw 9599 | 2021-05-23T16:50:45Z | 2021-05-24T17:15:48Z | OWNER | Still needed:
And maybe a UI mechanism for this? I could at least add a "remove this column" item to the cog menu on columns. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846668419 | https://github.com/simonw/datasette/issues/615#issuecomment-846668419 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjY2ODQxOQ== | simonw 9599 | 2021-05-24T01:14:27Z | 2021-05-24T01:14:27Z | OWNER | I tried allowing the removal of |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846660103 | https://github.com/simonw/datasette/issues/615#issuecomment-846660103 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjY2MDEwMw== | simonw 9599 | 2021-05-24T00:47:00Z | 2021-05-24T00:47:00Z | OWNER |
Removing the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846659272 | https://github.com/simonw/datasette/issues/615#issuecomment-846659272 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjY1OTI3Mg== | simonw 9599 | 2021-05-24T00:44:47Z | 2021-05-24T00:44:47Z | OWNER | I can't think of any good reasons to support passing the same column twice |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846627322 | https://github.com/simonw/datasette/issues/615#issuecomment-846627322 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjYyNzMyMg== | simonw 9599 | 2021-05-23T21:31:22Z | 2021-05-23T21:31:22Z | OWNER | Would it be useful to allow this mechanism to alias columns, for example supporting one of the following:
This could be handy for renaming columns to match a specific expected JSON output. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846627163 | https://github.com/simonw/datasette/issues/615#issuecomment-846627163 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjYyNzE2Mw== | simonw 9599 | 2021-05-23T21:30:01Z | 2021-05-23T21:30:01Z | OWNER | Interesting side-effect of this implementation is that you can both control column order and request the same column multiple times:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846626871 | https://github.com/simonw/datasette/issues/615#issuecomment-846626871 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjYyNjg3MQ== | simonw 9599 | 2021-05-23T21:27:36Z | 2021-05-23T21:27:36Z | OWNER | A better interface for this would be a full list of columns each with a checkbox for making it visible on invisible - this could then be used to apply a bulk change (rather than refreshing the interface after every removed column) and it could also be easily designed to work on narrow mobile screens where the cog icon is not visible. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846626567 | https://github.com/simonw/datasette/issues/615#issuecomment-846626567 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjYyNjU2Nw== | simonw 9599 | 2021-05-23T21:25:19Z | 2021-05-23T21:25:19Z | OWNER | Here's a bug: removing the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846599732 | https://github.com/simonw/datasette/issues/615#issuecomment-846599732 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjU5OTczMg== | simonw 9599 | 2021-05-23T17:46:45Z | 2021-05-23T17:46:45Z | OWNER | I've changed my mind about forbidding |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846595473 | https://github.com/simonw/datasette/issues/615#issuecomment-846595473 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjU5NTQ3Mw== | simonw 9599 | 2021-05-23T17:13:09Z | 2021-05-23T17:13:09Z | OWNER | Natalie suggests a quick way to implement "undo" would be to add a "Show all columns" item to that menu which only appears when at least one column is hidden. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846595091 | https://github.com/simonw/datasette/issues/615#issuecomment-846595091 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjU5NTA5MQ== | simonw 9599 | 2021-05-23T17:09:59Z | 2021-05-23T17:09:59Z | OWNER | Here's that prototype of a "Hide this column" cog menu button: Need a way to undo that once you've hidden a column - maybe a list of currently hidden columns that lets you un-hide them. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
846592392 | https://github.com/simonw/datasette/issues/615#issuecomment-846592392 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDg0NjU5MjM5Mg== | simonw 9599 | 2021-05-23T16:49:30Z | 2021-05-23T16:49:44Z | OWNER | I started looking at this again, inspired by #1326. I have a new diff that works against the latest ```diff diff --git a/datasette/views/table.py b/datasette/views/table.py index 4879228..f4b2ee2 100644 --- a/datasette/views/table.py +++ b/datasette/views/table.py @@ -64,6 +64,36 @@ class Row: class RowTableShared(DataView): + async def columns_to_select(self, db, table, request): + table_columns = await db.table_columns(table) + if "_col" in request.args and "_nocol" in request.args: + raise DatasetteError("Cannot use _col and _nocol at the same time") + if "_col" in request.args: + new_columns = [] + for column in request.args.getlist("_col"): + if column not in table_columns: + raise DatasetteError("_col={} is an invalid column".format(column)) + new_columns.append(column) + return new_columns + elif "_nocol" in request.args: + # Return all columns EXCEPT these + bad_columns = [ + column + for column in request.args.getlist("_nocol") + if column not in table_columns + ] + if bad_columns: + raise DatasetteError( + "_nocol={} - invalid columns".format(", ".join(bad_columns)) + ) + return [ + column + for column in table_columns + if column not in request.args.getlist("_nocol") + ] + else: + return table_columns + async def sortable_columns_for_table(self, database, table, use_rowid): db = self.ds.databases[database] table_metadata = self.ds.table_metadata(database, table) @@ -321,18 +351,16 @@ class TableView(RowTableShared): )
@@ -715,6 +743,8 @@ class TableView(RowTableShared): column = fk["column"] if column not in columns_to_expand: continue + if column not in columns: + continue expanded_columns.append(column) # Gather the values column_index = columns.index(column) ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
550146151 | https://github.com/simonw/datasette/issues/615#issuecomment-550146151 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDU1MDE0NjE1MQ== | simonw 9599 | 2019-11-06T05:06:27Z | 2019-11-06T05:06:27Z | OWNER | I'm going to always include the primary key (or rowid) - otherwise the table view will sometimes not include links to the row pages, which seems bad. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
549591028 | https://github.com/simonw/datasette/issues/615#issuecomment-549591028 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDU0OTU5MTAyOA== | simonw 9599 | 2019-11-04T23:15:28Z | 2019-11-04T23:15:28Z | OWNER | Demo: visit https://52fa79c.datasette.io/fixtures/roadside_attractions and click "View and edit SQL" - you'll be sent to https://52fa79c.datasette.io/fixtures?sql=select+pk%2C+name%2C+address%2C+latitude%2C+longitude+from+roadside_attractions+order+by+pk+limit+101 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 | |
549585571 | https://github.com/simonw/datasette/issues/615#issuecomment-549585571 | https://api.github.com/repos/simonw/datasette/issues/615 | MDEyOklzc3VlQ29tbWVudDU0OTU4NTU3MQ== | simonw 9599 | 2019-11-04T22:57:16Z | 2019-11-04T22:57:16Z | OWNER | First step: stop using |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?_col= and ?_nocol= support for toggling columns on table view 517451234 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [issue] INTEGER REFERENCES [issues]([id]) , [performed_via_github_app] TEXT); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 1