From e2ae0b678041a78226aae63415069da067c6e890 Mon Sep 17 00:00:00 2001 From: Mira Date: Thu, 19 Dec 2024 17:39:28 +0100 Subject: [PATCH] Apply suggestions from code review --- doc/development/api/plugins.rst | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/doc/development/api/plugins.rst b/doc/development/api/plugins.rst index 022324683..181feadd7 100644 --- a/doc/development/api/plugins.rst +++ b/doc/development/api/plugins.rst @@ -165,13 +165,10 @@ However, for some of them (types of :ref:`Log Entries `) we use a diffe In a ``Registry``, classes are collected at application startup, along with a unique key (in case of LogEntryType, the ``action_type``) as well as which plugin registered them. -To register a class, you can use one of several decorator provided by the Registry object: +To register a class, you can use one of several decorators provided by the Registry object: -.. code-block:: python - - @log_entry_types.new('my_pretix_plugin.some.action', _('Some action in My Pretix Plugin occured.')) - class MyPretixPluginLogEntryType(EventLogEntryType): - pass +.. autoclass:: pretix.base.logentrytypes.LogEntryTypeRegistry + :members: register, new, new_from_dict All files in which classes are registered need to be imported in the ``AppConfig.ready`` as explained in `Signals `_ above.