Added voucher_redeem_info signal and improved signal documentation

This commit is contained in:
Raphael Michel
2016-07-03 15:51:09 +02:00
parent 82f2a7ab67
commit 7b456a620d
6 changed files with 154 additions and 80 deletions

View File

@@ -10,65 +10,56 @@ specific type of plugin but might come in handy for various plugins.
HTML head injection
-------------------
These two signals allow you to put code inside the HTML ``<head>`` tag
of every page. One signal is for the front end, one for the back end. You
will get the request as a keyword argument ``request`` and can return plain
HTML. The ``request`` object will have an attribute ``event``.
.. automodule:: pretix.control.signals
:members: html_head
* ``pretix.presale.signals.html_head``
* ``pretix.control.signals.html_head``
.. automodule:: pretix.presale.signals
:members: html_head
Admin navigation
----------------
The following signals allow you to add additional views to the admin panel
navigation. You will get the request as a keyword argument ``return``.
Receivers are expected to return a list of dictionaries. The dictionaries
should contain at least the keys ``label`` and ``url``. You can also return
a fontawesome icon name with the key ``icon``, it will be respected depending
on the type of navigation. You should also return an ``active`` key with a boolean
set to ``True``, when this item should be marked as active. The ``request`` object
will have an attribute ``event``.
If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>`
in pretix.
``pretix.control.signals.nav_event``
The sidebar navigation when the admin has selected an event.
.. automodule:: pretix.control.signals
:members: nav_event
Footer links
------------
The signal ``pretix.presale.signals.footer_links`` allows you to add links to the footer of an event page. You
are expected to return a dictionary containing the keys ``label`` and ``url``.
.. automodule:: pretix.presale.signals
:members: footer_link
Order events
------------
There are multiple signals that will be sent out in the ordering cycle:
``pretix.base.signals.order_placed``
Sent out every time an order has been created. Provides the ``order`` as the only
keyword argument.
``pretix.base.signals.order_paid``
Sent out every time an order has been paid. Provides the ``order`` as the only
keyword argument.
.. automodule:: pretix.base.signals
:members: order_paid, order_placed
Voucher system
--------------
.. automodule:: pretix.presale.signals
:members: voucher_redeem_info
Dashboards
----------
.. automodule:: pretix.control.signals
:members: event_dashboard_widgets, user_dashboard_widgets
Displaying of log entries
-------------------------
To display an instance of the ``LogEntry`` model to a human user,
``pretix.base.signals.logentry_display`` will be sent out with a ``logentry`` argument.
The first received response that is not ``None`` will be used to display the log entry
to the user.
.. automodule:: pretix.base.signals
:members: logentry_display
Periodic tasks
--------------
The ``pretix.base.signals.periodic_task`` is a regular django signal (no pretix event
signal) that we send out every time the periodic task cronjob runs. This interval
is not sharply defined, it can be everything between a minute and a day. The actions
you perform should be idempotent, i.e. it should not make a difference if this is send
out more often than expected.
.. automodule:: pretix.base.signals
:members: periodic_task