{"html_url": "https://github.com/simonw/datasette/issues/521#issuecomment-507922465", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/521", "id": 507922465, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNzkyMjQ2NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-07-03T03:23:55Z", "updated_at": "2019-07-03T03:23:55Z", "author_association": "OWNER", "body": "Fixed by #533", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459621683, "label": "Easier way of creating custom row templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/521#issuecomment-505422550", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/521", "id": 505422550, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNTQyMjU1MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-25T12:28:48Z", "updated_at": "2019-06-25T12:28:48Z", "author_association": "OWNER", "body": "Still needed before merge: documentation! I can expand this section: https://datasette.readthedocs.io/en/stable/custom_templates.html#custom-templates", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459621683, "label": "Easier way of creating custom row templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/521#issuecomment-505421892", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/521", "id": 505421892, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNTQyMTg5Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-25T12:26:54Z", "updated_at": "2019-06-25T12:26:54Z", "author_association": "OWNER", "body": "This is starting to shape up. Example template:\r\n```\r\n{% for row in display_rows %}\r\n
\r\n
\r\n

\r\n {{ row[\"First_Name\"] }} {{ row[\"Last_Name\"] }}\r\n

\r\n {% if row[\"Link_to_Photo\"] %}\r\n \r\n {% endif %}\r\n {% for cell in row.cells[3:] %}\r\n {% if cell.raw and cell.column != \"createdTime\" %}\r\n

{{ cell.column }}: {{ cell.value }}

\r\n {% endif %}\r\n {% endfor %}\r\n
\r\n{% endfor %}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459621683, "label": "Easier way of creating custom row templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/521#issuecomment-505405030", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/521", "id": 505405030, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNTQwNTAzMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-25T11:34:21Z", "updated_at": "2019-06-25T11:34:21Z", "author_association": "OWNER", "body": "Actually I'm OK here - `display_columns_and_rows()` is already only used by the HTML template rendering path.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459621683, "label": "Easier way of creating custom row templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/521#issuecomment-505280611", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/521", "id": 505280611, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNTI4MDYxMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-25T04:46:10Z", "updated_at": "2019-06-25T04:46:10Z", "author_association": "OWNER", "body": "Of course I can't do it in this part of he code because it's constructing plain JSON objects here. \r\n\r\nI'll need to do it in the section that prepares special objects for the HTML.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459621683, "label": "Easier way of creating custom row templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/521#issuecomment-505279560", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/521", "id": 505279560, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNTI3OTU2MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-25T04:40:16Z", "updated_at": "2019-06-25T04:40:38Z", "author_association": "OWNER", "body": "I think the trick is to redefine what a \"cell_row\" is. Each row is currently a list of cells:\r\n\r\nhttps://github.com/simonw/datasette/blob/6341f8cbc7833022012804dea120b838ec1f6558/datasette/views/table.py#L159-L163\r\n\r\nI can redefine the row (the `cells` variable in the above example) as a thing-that-iterates-cells (hence behaving like a list) but that also supports `__getitem__` access for looking up cell values if you know the name of the column.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459621683, "label": "Easier way of creating custom row templates"}, "performed_via_github_app": null}