mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
actors_from_ids plugin hook and datasette.actors_from_ids() method (#2181)
* Prototype of actors_from_ids plugin hook, refs #2180 * datasette-remote-actors example plugin, refs #2180
This commit is contained in:
parent
c26370485a
commit
b645174271
5 changed files with 155 additions and 0 deletions
|
|
@ -322,6 +322,27 @@ await .render_template(template, context=None, request=None)
|
|||
|
||||
Renders a `Jinja template <https://jinja.palletsprojects.com/en/2.11.x/>`__ using Datasette's preconfigured instance of Jinja and returns the resulting string. The template will have access to Datasette's default template functions and any functions that have been made available by other plugins.
|
||||
|
||||
.. _datasette_actors_from_ids:
|
||||
|
||||
await .actors_from_ids(actor_ids)
|
||||
---------------------------------
|
||||
|
||||
``actor_ids`` - list of strings or integers
|
||||
A list of actor IDs to look up.
|
||||
|
||||
Returns a dictionary, where the keys are the IDs passed to it and the values are the corresponding actor dictionaries.
|
||||
|
||||
This method is mainly designed to be used with plugins. See the :ref:`plugin_hook_actors_from_ids` documentation for details.
|
||||
|
||||
If no plugins that implement that hook are installed, the default return value looks like this:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"1": {"id": "1"},
|
||||
"2": {"id": "2"}
|
||||
}
|
||||
|
||||
.. _datasette_permission_allowed:
|
||||
|
||||
await .permission_allowed(actor, action, resource=None, default=...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue