mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
row_actions() plugin hook, closes #2299
This commit is contained in:
parent
7339cc51de
commit
b8711988b9
7 changed files with 134 additions and 7 deletions
|
|
@ -423,6 +423,18 @@ def query_actions(datasette, database, query_name, sql):
|
|||
]
|
||||
|
||||
|
||||
@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),
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@hookimpl
|
||||
def database_actions(datasette, database, actor, request):
|
||||
if actor:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue