.json?_labels=1 to expand foreign keys, refs #233

Output looks something like this:

    {
        "rowid": 233,
        "TreeID": 121240,
        "qLegalStatus": {
            "value" 2,
            "label": "Private"
        }
        "qSpecies": {
            "value": 16,
            "label": "Sycamore"
        }
        "qAddress": "91 Commonwealth Ave",
        ...
    }
This commit is contained in:
Simon Willison 2018-06-15 08:52:43 -07:00
commit 825b8a2557
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
4 changed files with 107 additions and 3 deletions

View file

@ -193,3 +193,7 @@ The Datasette table view takes a number of special querystring arguments:
``?_next=TOKEN``
Pagination by continuation token - pass the token that was returned in the
``"next"`` property by the previous page.
``?_labels=1``
Indicates that you would like to expand any foreign key references. These
will be exposed in the JSON as ``{"value": 3, "label": "Monterey"}``.