kopia lustrzana https://github.com/simonw/datasette
More links between events documentation
rodzic
be4f02335f
commit
6ccef35cc9
|
@ -7,7 +7,7 @@ Datasette includes a mechanism for tracking events that occur while the software
|
|||
|
||||
The core Datasette application triggers events when certain things happen. This page describes those events.
|
||||
|
||||
Plugins can listen for events using the :ref:`plugin_hook_track_event` plugin hook, which will be called with instances of the following classes (or additional classes registered by other plugins):
|
||||
Plugins can listen for events using the :ref:`plugin_hook_track_event` plugin hook, which will be called with instances of the following classes - or additional classes :ref:`registered by other plugins <plugin_hook_register_events>`.
|
||||
|
||||
.. automodule:: datasette.events
|
||||
:members:
|
||||
|
|
|
@ -1769,7 +1769,7 @@ Datasette includes an internal mechanism for tracking analytical events. This ca
|
|||
|
||||
Plugins can register to receive events using the ``track_event`` plugin hook.
|
||||
|
||||
They can also define their own events for other plugins to receive using the ``register_events`` plugin hook, combined with calls to the ``datasette.track_event(...)`` internal method.
|
||||
They can also define their own events for other plugins to receive using the :ref:`register_events() plugin hook <plugin_hook_register_events>`, combined with calls to the :ref:`datasette.track_event() internal method <datasette_track_event>`.
|
||||
|
||||
.. _plugin_hook_track_event:
|
||||
|
||||
|
@ -1826,7 +1826,7 @@ register_events(datasette)
|
|||
``datasette`` - :ref:`internals_datasette`
|
||||
You can use this to access plugin configuration options via ``datasette.plugin_config(your_plugin_name)``.
|
||||
|
||||
This hook should return a list of ``Event`` subclasses that represent custom events that the plugin might send to the ``datasette.track_event()`` method.
|
||||
This hook should return a list of ``Event`` subclasses that represent custom events that the plugin might send to the :ref:`datasette.track_event() <datasette_track_event>` method.
|
||||
|
||||
This example registers event subclasses for ``ban-user`` and ``unban-user`` events:
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue