{"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397842194", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397842194, "node_id": "MDEyOklzc3VlQ29tbWVudDM5Nzg0MjE5NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-16T22:26:21Z", "updated_at": "2018-06-16T22:26:21Z", "author_association": "OWNER", "body": "Some demos:\r\n\r\n* https://datasette-labels-demo.now.sh/sf-trees-02c8ef1/Street_Tree_List - regular HTML view\r\n* https://datasette-labels-demo.now.sh/sf-trees-02c8ef1/Street_Tree_List?_labels=off - no labels\r\n* https://datasette-labels-demo.now.sh/sf-trees-02c8ef1/Street_Tree_List.json?_labels=on - JSON with all labels\r\n* https://datasette-labels-demo.now.sh/sf-trees-02c8ef1/Street_Tree_List.json?_label=qSpecies&_shape=array - JSON with specific labels in array shape\r\n* https://datasette-labels-demo.now.sh/sf-trees-02c8ef1/Street_Tree_List.csv?_labels=on - CSV with all labels\r\n* https://datasette-labels-demo.now.sh/sf-trees-02c8ef1/Street_Tree_List.csv?_label=qSpecies - CSV with specific labels", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397840676", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397840676, "node_id": "MDEyOklzc3VlQ29tbWVudDM5Nzg0MDY3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-16T21:49:50Z", "updated_at": "2018-06-16T21:49:50Z", "author_association": "OWNER", "body": "For the moment I'm going with `_labels=`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397839583", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397839583, "node_id": "MDEyOklzc3VlQ29tbWVudDM5NzgzOTU4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-16T21:23:14Z", "updated_at": "2018-06-16T21:23:44Z", "author_association": "OWNER", "body": "I'm a bit torn on naming - choices are:\r\n\r\n* `?_labels=on` and `?_label=col1&_label=col2`\r\n* `?_expands=on` (or `?_expand_all=on`) and `?_expand=col1&_expand=col2`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397839482", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397839482, "node_id": "MDEyOklzc3VlQ29tbWVudDM5NzgzOTQ4Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-16T21:21:03Z", "updated_at": "2018-06-16T21:21:03Z", "author_association": "OWNER", "body": "Should facets always have their labels expanded or should they also obey the `_labels` and `_label` querystring arguments?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397824991", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397824991, "node_id": "MDEyOklzc3VlQ29tbWVudDM5NzgyNDk5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-16T16:50:31Z", "updated_at": "2018-06-16T16:50:42Z", "author_association": "OWNER", "body": "I'm going to support `?_labels=` on HTML views, but I'll allow it to be used to turn them off (they are on by default) using `?_labels=off`.\r\n\r\nRelated: 7e0caa1e62607c6579101cc0e62bec8899013715 where I added a new `value_as_boolean` helper extracted from how `--config` works in `cli.py`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397729500", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397729500, "node_id": "MDEyOklzc3VlQ29tbWVudDM5NzcyOTUwMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-15T20:11:14Z", "updated_at": "2018-06-15T20:11:14Z", "author_association": "OWNER", "body": "The `.json` and `.csv` links displayed on the table page should default to using `?_labels=1` if Datasette detects that there are foreign key expansions available for the page.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397729319", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397729319, "node_id": "MDEyOklzc3VlQ29tbWVudDM5NzcyOTMxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-15T20:10:24Z", "updated_at": "2018-06-15T20:10:24Z", "author_association": "OWNER", "body": "I'm also going to add the ability to specify individual columns that you want to expand using `?_label=city_id&_label=state_id`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397668427", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397668427, "node_id": "MDEyOklzc3VlQ29tbWVudDM5NzY2ODQyNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-15T16:07:43Z", "updated_at": "2018-06-15T16:07:43Z", "author_association": "OWNER", "body": "Demo: https://datasette-json-labels-demo.now.sh/fixtures-fda0fea/facetable.json?_labels=1&_shape=array", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397663968", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397663968, "node_id": "MDEyOklzc3VlQ29tbWVudDM5NzY2Mzk2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-15T15:51:17Z", "updated_at": "2018-06-15T15:51:17Z", "author_association": "OWNER", "body": "Nearly done, but I need the HTML view to ignore the `?_labels=1` param (it throws an error at the moment).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397648080", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397648080, "node_id": "MDEyOklzc3VlQ29tbWVudDM5NzY0ODA4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-15T14:56:21Z", "updated_at": "2018-06-15T14:56:21Z", "author_association": "OWNER", "body": "I considered including a `\"table\"` key like this:\r\n\r\n```\r\n \"qLegalStatus\": {\r\n \"value\" 2,\r\n \"label\": \"Private\",\r\n \"table\": \"qLegalStatus\"\r\n }\r\n```\r\n\r\nThis would help generate the HTML links using just the JSON data. But... I realized that in a list of 50 rows that value would be duplicated 50 times which is a bit nasty.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/233#issuecomment-397637302", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/233", "id": 397637302, "node_id": "MDEyOklzc3VlQ29tbWVudDM5NzYzNzMwMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-15T14:24:08Z", "updated_at": "2018-06-15T14:55:19Z", "author_association": "OWNER", "body": "I'm going with the terminology \"labels\" here. You'll be able to add ``?_labels=1`` and the JSON will look something like this:\r\n```\r\n{\r\n \"rowid\": 233,\r\n \"TreeID\": 121240,\r\n \"qLegalStatus\": {\r\n \"value\" 2,\r\n \"label\": \"Private\"\r\n }\r\n \"qSpecies\": {\r\n \"value\": 16,\r\n \"label\": \"Sycamore\"\r\n }\r\n \"qAddress\": \"91 Commonwealth Ave\",\r\n ...\r\n}\r\n```\r\n\r\nI need this to help build foreign key expansions for CSV files, see #266 ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 316444720, "label": "Option to expose expanded foreign keys in JSON/CSV"}, "performed_via_github_app": null}