Expose current SQLite row to render_cell hook, closes #1300

This commit is contained in:
Simon Willison 2022-07-07 09:30:49 -07:00
commit 6373bb3414
6 changed files with 14 additions and 7 deletions

View file

@ -60,7 +60,7 @@ def publish_subcommand(publish):
@hookspec
def render_cell(value, column, table, database, datasette):
def render_cell(row, value, column, table, database, datasette):
"""Customize rendering of HTML table cell values"""

View file

@ -375,6 +375,7 @@ class QueryView(DataView):
# pylint: disable=no-member
plugin_display_value = None
for candidate in pm.hook.render_cell(
row=row,
value=value,
column=column,
table=None,

View file

@ -895,6 +895,7 @@ async def display_columns_and_rows(
# pylint: disable=no-member
plugin_display_value = None
for candidate in pm.hook.render_cell(
row=row,
value=value,
column=column,
table=table_name,