{"html_url": "https://github.com/simonw/datasette/issues/1003#issuecomment-706302863", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1003", "id": 706302863, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjMwMjg2Mw==", "user": {"value": 649467, "label": "mhalle"}, "created_at": "2020-10-09T17:17:06Z", "updated_at": "2020-10-09T17:17:06Z", "author_association": "NONE", "body": "I agree on the descriptive and python-consistent naming. There is already a tojson, but frankly i find the \"to\" and \"from\" confusing in a text templating language where what's a string and what's data isn't 100% transparent.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718238967, "label": "from_json jinja2 filter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1003#issuecomment-706281451", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1003", "id": 706281451, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjI4MTQ1MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T16:33:01Z", "updated_at": "2020-10-09T16:33:01Z", "author_association": "OWNER", "body": "I think `json_dumps()` and `json_loads()` as aliases for `json.dumps()` and `json.loads()` is the way to go here.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718238967, "label": "from_json jinja2 filter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1003#issuecomment-706273211", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1003", "id": 706273211, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjI3MzIxMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T16:16:38Z", "updated_at": "2020-10-09T16:16:38Z", "author_association": "OWNER", "body": "I'm not a huge fan of `from_json` as the name for this. Some other options:\r\n\r\n- Expose `json` directly so templates can do `json.loads()` and `json.dumps()` - this allows for outputting JSON too, which is useful. But is there anything else on the `json` module that shouldn't be exposed in templates?\r\n- `json_dumps()` and `json_loads()` template functions. I quite like that.\r\n- Something else?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718238967, "label": "from_json jinja2 filter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1003#issuecomment-706272322", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1003", "id": 706272322, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjI3MjMyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T16:14:56Z", "updated_at": "2020-10-09T16:14:56Z", "author_association": "OWNER", "body": "Yes I think that makes sense. I added `json` to the template context in Dogsheep Beta just a few days ago because I needed that: https://github.com/dogsheep/dogsheep-beta/blob/bed9df2b3ef68189e2e445427721a28f4e9b4887/dogsheep_beta/__init__.py#L176", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718238967, "label": "from_json jinja2 filter"}, "performed_via_github_app": null}