Clarify request or None for two hooks

This commit is contained in:
Simon Willison 2022-10-04 18:25:52 -07:00 committed by GitHub
commit b6ba117b79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1281,7 +1281,7 @@ menu_links(datasette, actor, request)
``actor`` - dictionary or None ``actor`` - dictionary or None
The currently authenticated :ref:`actor <authentication_actor>`. The currently authenticated :ref:`actor <authentication_actor>`.
``request`` - :ref:`internals_request` ``request`` - :ref:`internals_request` or None
The current HTTP request. This can be ``None`` if the request object is not available. The current HTTP request. This can be ``None`` if the request object is not available.
This hook allows additional items to be included in the menu displayed by Datasette's top right menu icon. This hook allows additional items to be included in the menu displayed by Datasette's top right menu icon.
@ -1330,7 +1330,7 @@ table_actions(datasette, actor, database, table, request)
``table`` - string ``table`` - string
The name of the table. The name of the table.
``request`` - :ref:`internals_request` ``request`` - :ref:`internals_request` or None
The current HTTP request. This can be ``None`` if the request object is not available. The current HTTP request. This can be ``None`` if the request object is not available.
This hook allows table actions to be displayed in a menu accessed via an action icon at the top of the table page. It should return a list of ``{"href": "...", "label": "..."}`` menu items. This hook allows table actions to be displayed in a menu accessed via an action icon at the top of the table page. It should return a list of ``{"href": "...", "label": "..."}`` menu items.