How to use the pretix.base.signals.EventPluginSignal function in pretix

To help you get started, we’ve selected a few pretix examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pretix / pretix / src / pretix / presale / signals.py View on Github external
from pretix.base.signals import EventPluginSignal

html_head = EventPluginSignal(
    providing_args=["request"]
)
"""
This signal allows you to put code inside the HTML ```` tag
of every page in the frontend. You will get the request as the keyword argument
``request`` and are expected to return plain HTML.

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

html_page_header = EventPluginSignal(
    providing_args=["request"]
)
"""
This signal allows you to put code right in the beginning of the HTML ```` tag
of every page in the frontend. You will get the request as the keyword argument
github pretix / pretix / src / pretix / presale / signals.py View on Github external
This signal is sent out to retrieve pages for the checkout flow. Receivers are expected to return
a subclass of ``pretix.presale.checkoutflow.BaseCheckoutFlowStep``.

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

voucher_redeem_info = EventPluginSignal(
    providing_args=["voucher"]
)
"""
This signal is sent out to display additional information on the "redeem a voucher" page

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

order_meta_from_request = EventPluginSignal(
    providing_args=["request"]
)
"""
This signal is sent before an order is created through the pretixpresale frontend. It allows you
to return a dictionary that will be merged in the meta_info attribute of the order.
You will receive the request triggering the order creation as the ``request`` keyword argument.

As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
"""
checkout_confirm_page_content = EventPluginSignal(
    providing_args=['request']
)
"""
This signals allows you to add HTML content to the confirmation page that is presented at the
end of the checkout process, just before the order is being created.
github pretix / pretix / src / pretix / presale / signals.py View on Github external
You will receive the request triggering the order creation as the ``request`` keyword argument.

As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
"""
checkout_confirm_page_content = EventPluginSignal(
    providing_args=['request']
)
"""
This signals allows you to add HTML content to the confirmation page that is presented at the
end of the checkout process, just before the order is being created.

As with all plugin signals, the ``sender`` keyword argument will contain the event. A ``request``
argument will contain the request object.
"""

fee_calculation_for_cart = EventPluginSignal(
    providing_args=['request', 'invoice_address', 'total', 'positions']
)
"""
This signals allows you to add fees to a cart. You are expected to return a list of ``OrderFee``
objects that are not yet saved to the database (because there is no order yet).

As with all plugin signals, the ``sender`` keyword argument will contain the event. A ``request``
argument will contain the request object and ``invoice_address`` the invoice address (useful for
tax calculation). The ``total`` keyword argument will contain the total cart sum without any fees.
You should not rely on this ``total`` value for fee calculations as other fees might interfere.
The ``positions`` argument will contain a list or queryset of ``CartPosition`` objects.
"""

contact_form_fields = EventPluginSignal(
    providing_args=[]
)
github pretix / pretix / src / pretix / control / signals.py View on Github external
* url (str, optional, if the full widget should be a link)

This is a regular django signal (no pretix event signal).
"""

voucher_form_html = EventPluginSignal(
    providing_args=['form']
)
"""
This signal allows you to add additional HTML to the form that is used for modifying vouchers.
You receive the form object in the ``form`` keyword argument.

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

voucher_form_class = EventPluginSignal(
    providing_args=['cls']
)
"""
This signal allows you to replace the form class that is used for modifying vouchers.
You will receive the default form class (or the class set by a previous plugin) in the
``cls`` argument so that you can inherit from it.

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

voucher_form_validation = EventPluginSignal(
    providing_args=['form']
)
"""
This signal allows you to add additional validation to the form that is used for
creating and modifying vouchers. You will receive the form instance in the ``form``
github pretix / pretix / src / pretix / control / signals.py View on Github external
providing_args=['user']
)
"""
This signal is sent out to include widgets in the personal user dashboard. Receivers
should return a list of dictionaries, where each dictionary can have the keys:

* content (str, containing HTML)
* display_size (str, one of "full" (whole row), "big" (half a row) or "small"
  (quarter of a row). May be ignored on small displays, default is "small")
* priority (int, used for ordering, higher comes first, default is 1)
* url (str, optional, if the full widget should be a link)

This is a regular django signal (no pretix event signal).
"""

voucher_form_html = EventPluginSignal(
    providing_args=['form']
)
"""
This signal allows you to add additional HTML to the form that is used for modifying vouchers.
You receive the form object in the ``form`` keyword argument.

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

voucher_form_class = EventPluginSignal(
    providing_args=['cls']
)
"""
This signal allows you to replace the form class that is used for modifying vouchers.
You will receive the default form class (or the class set by a previous plugin) in the
``cls`` argument so that you can inherit from it.
github pretix / pretix / src / pretix / presale / signals.py View on Github external
providing_args=["position"]
)
"""
This signals allows you to add form fields to the questions form that is presented during checkout
and by default asks for the questions configured in the backend. You are supposed to return a dictionary
of form fields with globally unique keys. The validated form results will be saved into the
``question_form_data`` entry of the position's meta_info dictionary.

The ``position`` keyword argument will contain either a ``CartPosition`` object or an ``OrderPosition``
object, depending on whether the form is called as part of the order checkout or for changing an order
later.

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

order_info = EventPluginSignal(
    providing_args=["order"]
)
"""
This signal is sent out to display additional information on the order detail page

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

position_info = EventPluginSignal(
    providing_args=["order", "position"]
)
"""
This signal is sent out to display additional information on the position detail page

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
github pretix / pretix / src / pretix / presale / signals.py View on Github external
As with all plugin signals, the ``sender`` keyword argument will contain the event. The
receivers are expected to return HTML.
"""

checkout_all_optional = EventPluginSignal(
    providing_args=['request']
)
"""
If any receiver of this signal returns ``True``, all input fields during checkout (contact data,
invoice address, confirmations) will be optional, except for questions. Use with care!

As with all plugin signals, the ``sender`` keyword argument will contain the event. A ``request``
argument will contain the request object.
"""

item_description = EventPluginSignal(
    providing_args=["item", "variation"]
)
"""
This signal is sent out when the description of an item or variation is rendered and allows you to append
github pretix / pretix / src / pretix / presale / signals.py View on Github external
As with all plugin signals, the ``sender`` keyword argument will contain the event. The
receivers are expected to return HTML.
"""

front_page_bottom_widget = EventPluginSignal(
    providing_args=["request", "subevent"]
)
"""
This signal is sent out to display additional information on the frontpage below the list
of products if the front page is shown in the widget.

As with all plugin signals, the ``sender`` keyword argument will contain the event. The
receivers are expected to return HTML.
"""

checkout_all_optional = EventPluginSignal(
    providing_args=['request']
)
"""
If any receiver of this signal returns ``True``, all input fields during checkout (contact data,
invoice address, confirmations) will be optional, except for questions. Use with care!

As with all plugin signals, the ``sender`` keyword argument will contain the event. A ``request``
argument will contain the request object.
"""

item_description = EventPluginSignal(
    providing_args=["item", "variation"]
)
"""
This signal is sent out when the description of an item or variation is rendered and allows you to append
github pretix / pretix / src / pretix / presale / signals.py View on Github external
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

front_page_top = EventPluginSignal(
    providing_args=["request", "subevent"]
)
"""
This signal is sent out to display additional information on the frontpage above the list
of products and but below a custom frontpage text.

As with all plugin signals, the ``sender`` keyword argument will contain the event. The
receivers are expected to return HTML.
"""

render_seating_plan = EventPluginSignal(
    providing_args=["request", "subevent", "voucher"]
)
"""
This signal is sent out to render a seating plan, if one is configured for the specific event.
You will be passed the ``request`` as a keyword argument. If applicable, a ``subevent`` or
``voucher`` argument might be given.

As with all plugin signals, the ``sender`` keyword argument will contain the event. The
receivers are expected to return HTML.
"""

front_page_bottom = EventPluginSignal(
    providing_args=["request", "subevent"]
)
"""
This signal is sent out to display additional information on the frontpage below the list
github pretix / pretix / src / pretix / control / signals.py View on Github external
As with all plugin signals, the ``sender`` keyword argument will contain the event.
A second keyword argument ``request`` will contain the request object.
"""

event_settings_widget = EventPluginSignal(
    providing_args=['request']
)
"""
This signal is sent out to include template snippets on the settings page of an event
that allows generating a pretix Widget code.

As with all plugin signals, the ``sender`` keyword argument will contain the event.
A second keyword argument ``request`` will contain the request object.
"""

item_forms = EventPluginSignal(
    providing_args=['request', 'item']
)
"""
This signal allows you to return additional forms that should be rendered on the product
modification page. You are passed ``request`` and ``item`` arguments and are expected to return
an instance of a form class that you bind yourself when appropriate. Your form will be executed
as part of the standard validation and rendering cycle and rendered using default bootstrap
styles. It is advisable to set a prefix for your form to avoid clashes with other plugins.

As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""

item_formsets = EventPluginSignal(
    providing_args=['request', 'item']
)
"""