home / docs / sections

sections: plugin_hooks:plugin-hook-row-actions

This data as json

id page ref title content breadcrumbs references
plugin_hooks:plugin-hook-row-actions plugin_hooks plugin-hook-row-actions row_actions(datasette, actor, request, database, table, row) datasette - Datasette class You can use this to access plugin configuration options via datasette.plugin_config(your_plugin_name) , or to execute SQL queries. actor - dictionary or None The currently authenticated actor . request - Request object or None The current HTTP request. database - string The name of the database. table - string The name of the table. row - sqlite.Row The SQLite row object being displayed on the page. Return links for the "Row actions" menu shown at the top of the row page. This example displays the row in JSON plus some additional debug information if the user is signed in: from datasette import hookimpl @hookimpl def row_actions(datasette, database, table, actor, row): if actor: return [ { "href": datasette.urls.instance(), "label": f"Row details for {actor['id']}", "description": json.dumps( dict(row), default=repr ), }, ] Example: datasette-enrichments ["Plugin hooks", "Action hooks"] [{"href": "https://datasette.io/plugins/datasette-enrichments", "label": "datasette-enrichments"}]
Powered by Datasette · Queries took 1.433ms