mirror of
https://github.com/simonw/datasette.git
synced 2026-10-29 06:37:01 +01:00
Row JSON: drop truncated, render_cell is a single object
The default row shape no longer includes "truncated", since a single row lookup cannot be truncated, and ?_extra=render_cell returns one object to match "row". With a ?_shape= both behave as they do for tables. Refs #2612 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GaqG8H8ajwxizKXdbGrtve
This commit is contained in:
parent
28184edc52
commit
cb0159e625
5 changed files with 28 additions and 19 deletions
|
|
@ -960,7 +960,7 @@ The following extras are available for row JSON responses.
|
|||
``render_cell``
|
||||
Rendered HTML for each cell using the render_cell plugin hook (See the :ref:`render_cell() plugin hook <plugin_hook_render_cell>` documentation.)
|
||||
|
||||
The ``render_cell`` array has one item for the requested row. The object is keyed by column name. Only columns whose rendered value differs from the default are included.
|
||||
The ``render_cell`` object is keyed by column name. Only columns whose rendered value differs from the default are included. If a ``?_shape=`` is specified ``render_cell`` is instead a list with one item, matching the ``rows`` list.
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
|
|
@ -969,11 +969,9 @@ The following extras are available for row JSON responses.
|
|||
"id": 4,
|
||||
"content": "RENDER_CELL_DEMO"
|
||||
},
|
||||
"render_cell": [
|
||||
{
|
||||
"content": "<strong>Custom rendered HTML</strong>"
|
||||
}
|
||||
]
|
||||
"render_cell": {
|
||||
"content": "<strong>Custom rendered HTML</strong>"
|
||||
}
|
||||
}
|
||||
|
||||
``debug``
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue