General APIs¶
This page lists some general signals and hooks which do not belong to a specific type of plugin but might come in handy for various plugins.
Core¶
- pretix.base.signals.device_info_updated = <pretix.base.signals.GlobalSignal object>¶
Arguments:
old_device,new_deviceThis signal is sent out each time the information for a Device is modified. Both the original and updated versions of the Device are included to allow receivers to see what has been updated.
- pretix.base.signals.email_filter = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
message,order,userThis signal allows you to implement a middleware-style filter on all outgoing emails. You are expected to return a (possibly modified) copy of the message object passed to you.
As with all event-plugin signals, the
senderkeyword argument will contain the event. Themessageargument will contain anEmailMultiAlternativesobject. If the email is associated with a specific order, theorderargument will be passed as well, otherwise it will beNone. If the email is associated with a specific user, e.g. a notification email, theuserargument will be passed as well, otherwise it will beNone.
- pretix.base.signals.event_copy_data = <pretix.base.signals.EventPluginSignal object>¶
Arguments: “other”,
tax_map,category_map,item_map,question_map,variation_map,checkin_list_map,quota_mapThis signal is sent out when a new event is created as a clone of an existing event, i.e. the settings from the older event are copied to the newer one. You can listen to this signal to copy data or configuration stored within your plugin’s models as well.
You don’t need to copy data inside the general settings storage which is cloned automatically, but you might need to modify that data.
The
senderkeyword argument will contain the event of the new event. Theotherkeyword argument will contain the event to copy from. The keyword argumentstax_map,category_map,item_map,question_map,quota_map,variation_mapandcheckin_list_mapcontain mappings from object IDs in the original event to objects in the new event of the respective types.
- pretix.base.signals.event_live_issues = <pretix.base.signals.EventPluginSignal object>¶
This signal is sent out to determine whether an event can be taken live. If you want to prevent the event from going live, return a string that will be displayed to the user as the error message. If you don’t, your receiver should return
None.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.gift_card_transaction_display = <pretix.base.signals.GlobalSignal object>¶
Arguments:
transaction,customer_facingTo display an instance of the
GiftCardTransactionmodel to a human user,pretix.base.signals.gift_card_transaction_displaywill be sent out with atransactionargument. Thecustomer_facingargument specifies whether the HTML will be shown to an end-user or if it is being used in the backend.The first received response that is not
Nonewill be used to display the log entry to the user. The receivers are expected to return a string (that might be marked withmark_safefrom Django if it contains HTML).
- pretix.base.signals.global_email_filter = <pretix.base.signals.GlobalSignal object>¶
Arguments:
message,order,user,customer,organizerThis signal allows you to implement a middleware-style filter on all outgoing emails. You are expected to return a (possibly modified) copy of the message object passed to you.
This signal is called on all events and even if there is no known event.
senderis an event or None. Themessageargument will contain anEmailMultiAlternativesobject. If the email is associated with a specific order, theorderargument will be passed as well, otherwise it will beNone. If the email is associated with a specific user, e.g. a notification email, theuserargument will be passed as well, otherwise it will beNone.
- pretix.base.signals.item_copy_data = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
source,targetThis signal is sent out when a new product is created as a clone of an existing product, i.e. the settings from the older product are copied to the newer one. You can listen to this signal to copy data or configuration stored within your plugin’s models as well.
The
senderkeyword argument will contain the event. Thetargetwill contain the item to copy to, thesourcekeyword argument will contain the product to copy from.
- pretix.base.signals.notification = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
logentry_id,notification_typeThis signal is sent out when a notification is sent.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.periodic_task = <pretix.base.signals.GlobalSignal object>¶
This 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 sent out more often than expected.
- pretix.base.signals.quota_availability = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
quota,result,count_waitinglistThis signal allows you to modify the availability of a quota. You are passed the
quotaand anavailabilityresult calculated by pretix code or other plugins.availabilityis a tuple with the first entry being one of theQuota.AVAILABILITY_*constants and the second entry being the number of available tickets (orNonefor unlimited). You are expected to return a value of the same type. The parametercount_waitinglistsspecifies whether waiting lists should be taken into account.Warning: Use this signal with great caution, it allows you to screw up the performance of the system really bad. Also, keep in mind that your response is subject to caching and out-of-date quotas might be used for display (not for actual order processing).
- pretix.base.signals.register_global_settings = <pretix.base.signals.GlobalSignal object>¶
All plugins that are installed may send fields for the global settings form, as an OrderedDict of (setting name, form field).
- pretix.base.signals.register_mail_placeholders = <pretix.base.signals.EventPluginSignal object>¶
DEPRECATED: This signal has a new name, please use
register_text_placeholdersinstead.
- pretix.base.signals.register_notification_types = <pretix.base.signals.EventPluginSignal object>¶
This signal is sent out to get all known notification types. Receivers should return an instance of a subclass of pretix.base.notifications.NotificationType or a list of such instances.
As with all event-plugin signals, the
senderkeyword argument will contain the event, however for this signal, thesendermay also be None to allow creating the general notification settings!
- pretix.base.signals.register_sales_channel_types = <pretix.base.signals.GlobalSignal object>¶
This signal is sent out to get all known sales channels types. Receivers should return an instance of a subclass of
pretix.base.channels.SalesChannelTypeor a list of such instances.
- pretix.base.signals.register_text_placeholders = <pretix.base.signals.EventPluginSignal object>¶
This signal is sent out to get all known text placeholders. Receivers should return an instance of a subclass of pretix.base.services.placeholders.BaseTextPlaceholder or a list of these.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.register_ticket_secret_generators = <pretix.base.signals.EventPluginSignal object>¶
This signal is sent out to get all known ticket secret generators. Receivers should return a subclass of
pretix.base.secrets.BaseTicketSecretGeneratoror a list of theseAs with all event-plugin signals, the
senderkeyword argument will contain the event.
Order events¶
There are multiple signals that will be sent out in the ordering cycle:
- pretix.base.signals.allow_ticket_download = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out to check if tickets for an order can be downloaded. If any receiver returns false, a download will not be offered. If a receiver returns a list of OrderPositions, only those will be downloadable.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.build_invoice_data = <pretix.base.signals.EventPluginSignal object>
Arguments:
invoiceThis signal is sent out every time an invoice is built, after the invoice model was created and filled and before the PDF generation task is started. You can use this to make changes to the invoice, but we recommend to mostly use it to add content to
Invoice.plugin_data. You are responsible for saving any changes to the database.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.invoice_line_text = <pretix.base.signals.EventPluginSignal object>
Arguments:
positionThis signal is sent out when an invoice is built for an order. You can return additional text that should be shown on the invoice for the given
position.
- pretix.base.signals.order_approved = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time an order is being approved. The order object is given as the first argument.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_canceled = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time an order is canceled. The order object is given as the first argument.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_changed = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time an order’s content is changed. The order object is given as the first argument. In contrast to
modified, this signal is sent out if the order or any of its positions changes in a material way, such as changed products, prices, or tax rates,order_changedis used instead. If “only” user input is changed, such as attendee names, invoice addresses or question answers,order_modifiedis used instead.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_denied = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time an order is being denied. The order object is given as the first argument.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_expired = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time an order is marked as expired. The order object is given as the first argument.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_expiry_changed = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time an order expiry date is changed as an explicit operation (i.e. not if this is the result of an approval or order change). The order object is given as the first argument.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_fee_calculation = <pretix.base.signals.EventPluginSignal object>
Arguments:
positions,invoice_address,meta_info,total,gift_cards,payment_requestsThis signals allows you to add fees to an order while it is being created. You are expected to return a list of
OrderFeeobjects that are not yet saved to the database (because there is no order yet).As with all event plugin signals, the
senderkeyword argument will contain the event. Apositionsargument will contain the cart positions andinvoice_addressthe invoice address (useful for tax calculation). The argumentmeta_infocontains the order’s meta dictionary. Thetotalkeyword argument will contain the total cart sum without any fees. You should not rely on thistotalvalue for fee calculations as other fees might interfere. Thegift_cardsargument lists the gift cards in use.DEPRECTATION: Stop listening to the
gift_cardsattribute, it will be removed in the future.
- pretix.base.signals.order_fee_type_name = <pretix.base.signals.EventPluginSignal object>
Arguments:
request,feeThis signals allows you to return a human-readable description for a fee type based on the
fee_typeandinternal_typeattributes of theOrderFeemodel that you get as keyword arguments. You are expected to return a string or None, if you don’t know about this fee.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_gracefully_delete = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time a test-mode order is being deleted. The order object is given as the first argument.
Any plugin receiving this signals is supposed to perform any cleanup necessary at this point, so that the underlying order has no more external constraints that would inhibit the deletion of the order.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_modified = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time an order’s information is modified. The order object is given as the first argument. In contrast to
order_changed, this signal is sent out if information of an order or any of it’s position is changed that concerns user input, such as attendee names, invoice addresses or question answers. If the order changes in a material way, such as changed products, prices, or tax rates,order_changedis used instead.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_paid = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time an order is paid. The order object is given as the first argument. This signal is not sent out if an order is marked as paid because an already-paid order has been split.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_placed = <pretix.base.signals.EventPluginSignal object>
Arguments:
order,bulkThis signal is sent out every time an order is placed. The order object is given as the first argument. The
bulkargument specifies whether the order was placed as part of a bulk action, e.g. an import from a file. This signal is not sent out if an order is created through splitting an existing order, so you can not expect to see all orders by listening to this signal.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_reactivated = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out every time a canceled order is reactivated. The order object is given as the first argument.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.order_split = <pretix.base.signals.EventPluginSignal object>
Arguments:
original,split_orderThis signal is sent out when an order is split into two orders and allows you to copy related models to the new order. You will be passed the old order as
originaland the new order assplit_order.
- pretix.base.signals.order_valid_if_pending = <pretix.base.signals.EventPluginSignal object>
Arguments:
payments,positions,email,locale,invoice_address,meta_info,customerThis signal is sent out when the user tries to confirm the order, before we actually create the order. It allows you to set the
valid_if_pendingof the order even before it is created. Whenever any plugin returnsTrue, the order will be valid if pending.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.validate_cart = <pretix.base.signals.EventPluginSignal object>
Arguments:
positionsThis signal is sent out before the user starts checkout. It includes an iterable with the current CartPosition objects. The response of receivers will be ignored, but you can raise a CartError with an appropriate exception message.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.validate_cart_addons = <pretix.base.signals.EventPluginSignal object>
Arguments:
addons,base_position,iaoThis signal is sent when a user tries to select a combination of addons. In contrast to
validate_cart, this is executed before the cart is actually modified. You are passed an argumentaddonscontaining a dict of(item, variation or None) → counttuples as well as theItemAddOnobject as the argumentiaoand the base cart position asbase_position. The response of receivers will be ignored, but you can raise a CartError with an appropriate exception message.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.validate_order = <pretix.base.signals.EventPluginSignal object>
Arguments:
payments,positions,email,locale,invoice_address,meta_info,customerThis signal is sent out when the user tries to confirm the order, before we actually create the order. It allows you to inspect the cart positions. Your return value will be ignored, but you can raise an OrderError with an appropriate exception message if you like to block the order. We strongly discourage making changes to the order here.
As with all event-plugin signals, the
senderkeyword argument will contain the event.DEPRECTATION: Stop listening to the
payment_providerattribute, it will be removed in the future, as thepaymentsattribute gives more information.
Check-ins¶
- pretix.base.signals.checkin_annulled = <pretix.base.signals.EventPluginSignal object>
Arguments:
checkinThis signal is sent out every time a check-in is annulled (i.e. changed to unsuccessful after it already was successful).
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.checkin_created = <pretix.base.signals.EventPluginSignal object>
Arguments:
checkinThis signal is sent out every time a check-in is created (i.e. an order position is marked as checked in). It is not send if the position was already checked in and is force-checked-in a second time. The check-in object is given as the first argument.
For backwards compatibility reasons, this signal is only sent when a successful scan is saved.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
Frontend¶
- pretix.presale.signals.checkout_all_optional = <pretix.base.signals.EventPluginSignal object>¶
Arguments: ‘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 event plugin signals, the
senderkeyword argument will contain the event. Arequestargument will contain the request object.
- pretix.presale.signals.checkout_confirm_messages = <pretix.base.signals.EventPluginSignal object>¶
This signal is sent out to retrieve short messages that need to be acknowledged by the user before the order can be completed. This is typically used for something like “accept the terms and conditions”. Receivers are expected to return a dictionary where the keys are globally unique identifiers for the message and the values can be arbitrary HTML.
As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.checkout_confirm_page_content = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
requestThis 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 event plugin signals, the
senderkeyword argument will contain the event. Arequestargument will contain the request object.
- pretix.presale.signals.checkout_flow_steps = <pretix.base.signals.EventPluginSignal object>¶
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 event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.contact_form_fields = <pretix.base.signals.EventPluginSignal object>¶
This signals allows you to add form fields to the contact form that is presented during checkout and by default only asks for the email address. You are supposed to return a dictionary of form fields with globally unique keys. The validated form results will be saved into the
contact_form_dataentry of the order’s meta_info dictionary.As with all event plugin signals, the
senderkeyword argument will contain the event. Arequestargument will contain the request object.
- pretix.presale.signals.contact_form_fields_overrides = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
request,orderThis signal allows you to override fields of the contact form that is presented during checkout and by default only asks for the email address. It is also being used for the invoice address form. You are supposed to return a dictionary of dictionaries with globally unique keys. The value-dictionary should contain one or more of the following keys:
initial,disabled,validators. The key of the dictionary should be the name of the form field.As with all event plugin signals, the
senderkeyword argument will contain the event. Arequestargument will contain the request object. Theorderargument isNoneduring the checkout process and contains an order if the customer is trying to change an existing order.
- pretix.presale.signals.fee_calculation_for_cart = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
request,invoice_address,total,positions,payment_requetssThis signals allows you to add fees to a cart. You are expected to return a list of
OrderFeeobjects that are not yet saved to the database (because there is no order yet).As with all event plugin signals, the
senderkeyword argument will contain the event. Arequestargument will contain the request object andinvoice_addressthe invoice address (useful for tax calculation). Thetotalkeyword argument will contain the total cart sum without any fees. You should not rely on thistotalvalue for fee calculations as other fees might interfere. Thepositionsargument will contain a list or queryset ofCartPositionobjects.
- pretix.presale.signals.filter_subevents = <pretix.base.signals.GlobalSignal object>¶
Arguments:
subevents,sales_channelThis signal allows you to filter which subevents are publicly available. Receivers are passed a list of subevents that are about to be shown to the user and are expected to return a list of the same format, with all subevents removed that should not be available for sale.
sales_channelsis astrwith the sales channel identifier.This is not an event-plugin signal as this will also be called on other levels when showing a list of subevents across events. Expect that the subevents in the input are mixed from different events or even different organizers. However, receivers will only receive subevents of events that the plugin is active for and can only filter out these. It is recommended that receivers return a subset of the same subevent instances that are passed in, not new instances, to ensure prefetch_related calls on the caller side are not pointless.
Arguments:
requestThe signal
pretix.presale.signals.footer_linkallows you to add links to the footer of an event page. You are expected to return a dictionary containing the keyslabelandurl.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.front_page_bottom = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
request,subeventThis signal is sent out to display additional information on the frontpage below the list of products.
As with all event plugin signals, the
senderkeyword argument will contain the event. The receivers are expected to return HTML.
- pretix.presale.signals.front_page_bottom_widget = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
request,subeventThis 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 event plugin signals, the
senderkeyword argument will contain the event. The receivers are expected to return HTML.
- pretix.presale.signals.front_page_top = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
request,subeventThis 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 event plugin signals, the
senderkeyword argument will contain the event. The receivers are expected to return HTML.
Arguments:
requestThe signal
pretix.presale.signals.global_footer_linkallows you to add links to the footer of any page. You are expected to return a dictionary containing the keyslabelandurl.
Arguments:
requestThis signal allows you to put code before the end of the HTML
<body>tag of every page in the frontend. You will get the request as the keyword argumentrequestand are expected to return plain HTML.This signal is called regardless of whether your plugin is active for all pages of the system.
- pretix.presale.signals.global_html_head = <pretix.base.signals.GlobalSignal object>¶
Arguments:
requestThis signal allows you to put code inside the HTML
<head>tag of every page in the frontend. You will get the request as the keyword argumentrequestand are expected to return plain HTML.This signal is called regardless of whether your plugin is active for all pages of the system.
- pretix.presale.signals.global_html_page_header = <pretix.base.signals.GlobalSignal object>¶
Arguments:
requestThis signal allows you to put code right in the beginning of the HTML
<body>tag of every page in the frontend. You will get the request as the keyword argumentrequestand are expected to return plain HTML.This signal is called regardless of whether your plugin is active for all pages of the system.
Arguments:
requestThis signal allows you to put code before the end of the HTML
<body>tag of every page in the frontend. You will get the request as the keyword argumentrequestand are expected to return plain HTML.As with all event plugin signals, the
senderkeyword argument will contain the event.Note: If PCI DSS compliance is important to you and you keep an inventory according to rule 6.4.3 of PCI DSS, all plugins that are not required to load on a payment page should not return additional JavaScripts if
getattr(request, 'pci_dss_payment_page', False)isTrue.
- pretix.presale.signals.html_head = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
requestThis signal allows you to put code inside the HTML
<head>tag of every page in the frontend. You will get the request as the keyword argumentrequestand are expected to return plain HTML.As with all event plugin signals, the
senderkeyword argument will contain the event.Note: If PCI DSS compliance is important to you and you keep an inventory according to rule 6.4.3 of PCI DSS, all plugins that are not required to load on a payment page should not return additional JavaScripts if
getattr(request, 'pci_dss_payment_page', False)isTrue.
- pretix.presale.signals.html_page_header = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
requestThis signal allows you to put code right in the beginning of the HTML
<body>tag of every page in the frontend. You will get the request as the keyword argumentrequestand are expected to return plain HTML.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.item_description = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
item,variation,subeventThis signal is sent out when the description of an item or variation is rendered and allows you to append additional text to the description. You are passed the
item,variationandsubevent. You are expected to return HTML.
- pretix.presale.signals.position_info = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
order,position,requestThis signal is sent out to display additional information on the position detail page
As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.position_info_top = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
order,position,requestThis signal is sent out to display additional information on top of the position detail page
As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.question_form_fields = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
positionThis 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_dataentry of the position’s meta_info dictionary.The
positionkeyword argument will contain either aCartPositionobject or anOrderPositionobject, depending on whether the form is called as part of the order checkout or for changing an order later.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.question_form_fields_overrides = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
position,requestThis signal allows you to override fields of the questions form that is presented during checkout and by default only asks for the questions configured in the backend. You are supposed to return a dictionary of dictionaries with globally unique keys. The value-dictionary should contain one or more of the following keys:
initial,disabled,validators. The key of the dictionary should be the form field name for system fields (e.g.company), or the question’sidentifierfor user-defined questions.The
positionkeyword argument will contain aCartPositionorOrderPositionobject.As with all event plugin signals, the
senderkeyword argument will contain the event. Arequestargument will contain the request object.
- pretix.presale.signals.render_seating_plan = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
request,subevent,voucherThis signal is sent out to render a seating plan, if one is configured for the specific event. You will be passed the
requestas a keyword argument. If applicable, asubeventorvoucherargument might be given.As with all event plugin signals, the
senderkeyword argument will contain the event. The receivers are expected to return HTML.
- pretix.presale.signals.seatingframe_html_head = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
requestTemporary workaround, might be removed again later. This signal allows you to put code inside the HTML
<head>tag of the seatingframe page in the frontend. You will get the request as the keyword argumentrequestand are expected to return plain HTML.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.order_api_meta_from_request = <pretix.base.signals.EventPluginSignal object>
Arguments:
requestThis 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 api_meta attribute of the order. You will receive the request triggering the order creation as the
requestkeyword argument.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.order_info = <pretix.base.signals.EventPluginSignal object>
Arguments:
order,requestThis signal is sent out to display additional information on the order detail page
As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.order_info_top = <pretix.base.signals.EventPluginSignal object>
Arguments:
order,requestThis signal is sent out to display additional information on top of the order detail page
As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.order_meta_from_request = <pretix.base.signals.EventPluginSignal object>
Arguments:
requestThis 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
requestkeyword argument.As with all event-plugin signals, the
senderkeyword argument will contain the event.
Request flow¶
- pretix.presale.signals.process_request = <pretix.base.signals.EventPluginSignal object>
Arguments:
requestThis signal is sent out whenever a request is made to a event presale page. Most of the time, this will be called from the middleware layer (except on plugin-provided pages this will be called by the @event_view decorator). Similarly to Django’s process_request middleware method, if you return a Response, that response will be used and the request won’t be processed any further down the stack.
WARNING: Be very careful about using this signal as listening to it makes it really easy to cause serious performance problems.
As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.presale.signals.process_response = <pretix.base.signals.EventPluginSignal object>
Arguments:
request,responseThis signal is sent out whenever a response is sent from a event presale page. Most of the time, this will be called from the middleware layer (except on plugin-provided pages this will be called by the @event_view decorator). Similarly to Django’s process_response middleware method you must return a response object, that will be passed further up the stack to other handlers of the signal. If you do not want to alter the response, just return the
responseparameter.WARNING: Be very careful about using this signal as listening to it makes it really easy to cause serious performance problems.
As with all event plugin signals, the
senderkeyword argument will contain the event.
Vouchers¶
- pretix.presale.signals.voucher_redeem_info = <pretix.base.signals.EventPluginSignal object>
Arguments:
voucherThis signal is sent out to display additional information on the “redeem a voucher” page
As with all event plugin signals, the
senderkeyword argument will contain the event.
Backend¶
- pretix.control.signals.event_settings_widget = <pretix.base.signals.EventPluginSignal object>¶
Arguments: ‘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 event plugin signals, the
senderkeyword argument will contain the event. A second keyword argumentrequestwill contain the request object.
- pretix.control.signals.html_head = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
requestThis signal allows you to put code inside the HTML
<head>tag of every page in the backend. You will get the request as the keyword argumentrequestand are expected to return plain HTML.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.control.signals.html_page_start = <pretix.base.signals.GlobalSignal object>¶
This signal allows you to put code in the beginning of the main page for every page in the backend. You are expected to return HTML.
The
senderkeyword argument will contain the request.
- pretix.control.signals.item_formsets = <pretix.base.signals.EventPluginSignal object>¶
Arguments: ‘request’, ‘item’
This signal allows you to return additional formsets that should be rendered on the product modification page. You are passed
requestanditemarguments and are expected to return an instance of a formset class that you bind yourself when appropriate. Your formset 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 formset to avoid clashes with other plugins.Your formset needs to have two special properties:
templatewith a template that will be included to render the formset andtitlethat will be used as a headline. Your template will be passed aformsetvariable with your formset.As with all event plugin signals, the
senderkeyword argument will contain the event.
Arguments:
requestThis signal allows you to add additional views to the admin panel navigation. You will get the request as a keyword argument
request. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keyslabelandurl. You can also return a fontawesome icon name with the keyicon, it will be respected depending on the type of navigation. You should also return anactivekey with a boolean set toTrue, when this item should be marked as active. Therequestobject will have an attributeevent.You can optionally create sub-items to create hierarchical navigation. There are two ways to achieve this: Either you specify a key
childrenon your top navigation item that contains a list of navigation items (as dictionaries), or you specify aparentkey with theurlvalue of the designated parent item. The latter method also allows you to register navigation items as a sub-item of existing ones.If you use this, you should read the documentation on how to deal with URLs in pretix.
As with all event plugin signals, the
senderkeyword argument will contain the event.
Arguments: ‘request’
This signal is sent out to include tab links on the settings page of an event. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys
labelandurl. You should also return anactivekey with a boolean set toTrue, when this item should be marked as active.If your linked view should stay in the tab-like context of this page, we recommend that you use
pretix.control.views.event.EventSettingsViewMixinfor your view and your template inherits frompretixcontrol/event/settings_base.html.As with all event plugin signals, the
senderkeyword argument will contain the event. A second keyword argumentrequestwill contain the request object.
Arguments:
requestThis signal allows you to add additional views to the navigation bar when no event is selected. You will get the request as a keyword argument
request. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keyslabelandurl. You can also return a fontawesome icon name with the keyicon, it will be respected depending on the type of navigation. You should also return anactivekey with a boolean set toTrue, when this item should be marked as active.You can optionally create sub-items to create hierarchical navigation. There are two ways to achieve this: Either you specify a key
childrenon your top navigation item that contains a list of navigation items (as dictionaries), or you specify aparentkey with theurlvalue of the designated parent item. The latter method also allows you to register navigation items as a sub-item of existing ones.If you use this, you should read the documentation on how to deal with URLs in pretix.
This is no
EventPluginSignal, so you do not get the event in thesenderargument and you may get the signal regardless of whether your plugin is active.
Arguments: ‘organizer’, ‘request’
This signal is sent out to include tab links on the detail page of an organizer. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys
labelandurl. You should also return anactivekey with a boolean set toTrue, when this item should be marked as active.You can optionally create sub-items to create hierarchical navigation. There are two ways to achieve this: Either you specify a key
childrenon your top navigation item that contains a list of navigation items (as dictionaries), or you specify aparentkey with theurlvalue of the designated parent item. The latter method also allows you to register navigation items as a sub-item of existing ones.If your linked view should stay in the tab-like context of this page, we recommend that you use
pretix.control.views.organizer.OrganizerDetailViewMixinfor your view and your template inherits frompretixcontrol/organizers/base.html.This is an organizer plugin signal (not an event-level signal). Organizer and hybrid plugins, will receive it if they’re active for the current organizer.
Deprecation Notice: Currently, event plugins can always receive this signal, regardless of activation. In the future, event plugins will not be allowed to register to organizer-level signals.
Receivers will be passed the keyword arguments
organizerandrequest.
Arguments:
requestThis signal allows you to add additional views to the top navigation bar. You will get the request as a keyword argument
request. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keyslabelandurl. You can also return a fontawesome icon name with the keyicon, it will be respected depending on the type of navigation. If set, on desktops only theiconwill be shown. Thetitleproperty can be used to set the alternative text.If you use this, you should read the documentation on how to deal with URLs in pretix.
This is no
EventPluginSignal, so you do not get the event in thesenderargument and you may get the signal regardless of whether your plugin is active.
- pretix.control.signals.oauth_application_registered = <pretix.base.signals.GlobalSignal object>¶
Arguments:
user,applicationThis signal will be called whenever a user registers a new OAuth application.
- pretix.control.signals.order_info = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
order,requestThis signal is sent out to display additional information on the order detail page
As with all event plugin signals, the
senderkeyword argument will contain the event. Additionally, the argumentorderandrequestare available.
- pretix.control.signals.order_position_buttons = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
order,position,requestThis signal is sent out to display additional buttons for a single position of an order.
As with all event plugin signals, the
senderkeyword argument will contain the event. Additionally, the argumentorderandrequestare available.
- pretix.control.signals.order_search_filter_q = <pretix.base.signals.GlobalSignal object>¶
Arguments:
queryThis signal will be called whenever a free-text order search is performed. You are expected to return one Q object that will be OR-ed with existing search queries. As order search exists on a global level as well, this is not an Event signal and will be called even if your plugin is not active.
senderwill contain the event if the search is performed within an event, andNoneotherwise. The search query will be passed asquery.
- pretix.control.signals.order_search_forms = <pretix.base.signals.EventPluginSignal object>¶
Arguments: ‘request’
This signal allows you to return additional forms that should be rendered in the advanced order search. You are passed
requestargument 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.You are required to set
prefixon your form instance. You are required to implement afilter_qs(queryset)method on your form that returns a new, filtered query set. You are required to implement afilter_to_strings()method on your form that returns a list of strings describing the currently active filters.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.control.signals.quota_detail_html = <pretix.base.signals.EventPluginSignal object>¶
Arguments: ‘quota’
This signal allows you to append HTML to a Quota’s detail view. You receive the quota as argument in the
quotakeyword argument.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.control.signals.subevent_forms = <pretix.base.signals.EventPluginSignal object>¶
Arguments: ‘request’, ‘subevent’, ‘copy_from’
This signal allows you to return additional forms that should be rendered on the subevent creation or modification page. You are passed
requestandsubeventarguments 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.subeventcan beNoneduring creation. Beforesave()is called, asubeventproperty of your form instance will automatically being set to the subevent that has just been created. During creation,copy_fromcan be a subevent that is being copied from.Your forms may also have two special properties:
templatewith a template that will be included to render the form, andtitle, which will be used as a headline. Your template will be passed aformvariable with your form.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.customer_created = <pretix.base.signals.OrganizerPluginSignal object>
Arguments:
customerThis signal is sent out every time a customer account is created. The
customerobject is given as the first argument.The
senderkeyword argument will contain the organizer.
- pretix.base.signals.customer_signed_in = <pretix.base.signals.OrganizerPluginSignal object>
Arguments:
customerThis signal is sent out every time a customer signs in. The
customerobject is given as the first argument.The
senderkeyword argument will contain the organizer.
- pretix.base.signals.logentry_display = <pretix.base.signals.EventPluginSignal object>
Arguments:
logentryDEPRECTATION: Please do not use this signal for new LogEntry types. Use the log_entry_types registry instead, as described in https://docs.pretix.eu/en/latest/development/implementation/logging.html
- pretix.base.signals.logentry_object_link = <pretix.base.signals.EventPluginSignal object>
Arguments:
logentryDEPRECTATION: Please do not use this signal for new LogEntry types. Use the log_entry_types registry instead, as described in https://docs.pretix.eu/en/latest/development/implementation/logging.html
- pretix.base.signals.orderposition_blocked_display = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderposition,block_nameTo display the reason for a blocked ticket to a backend user,
pretix.base.signals.orderposition_block_displaywill be sent out.The first received response that is not
Nonewill be used to display the block to the user. The receivers are expected to return plain text.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.requiredaction_display = <pretix.base.signals.EventPluginSignal object>
DEPRECATED, will no longer be called.
- pretix.base.signals.timeline_events = <pretix.base.signals.EventPluginSignal object>
This signal is sent out to collect events for the time line shown on event dashboards. You are passed a
subeventargument which might be none and you are expected to return a list of instances ofpretix.base.timeline.TimelineEvent, which is anamedtuplewith the fieldsevent,subevent,datetime,descriptionandedit_url.
Vouchers¶
- pretix.control.signals.item_forms = <pretix.base.signals.EventPluginSignal object>
Arguments: ‘request’, ‘item’
This signal allows you to return additional forms that should be rendered on the product modification page. You are passed
requestanditemarguments 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.Your forms may also have special properties:
templatewith a template that will be included to render the form. Your template will be passed aformvariable with your form.title, which will be used as a headline.ìs_layouts = True, if your form should be grouped with the ticket layout settings (mutually exclusive with settingtitle).group_with_formset = True, if your form should be grouped with a formset of the sametitle
As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.control.signals.voucher_form_class = <pretix.base.signals.EventPluginSignal object>
Arguments:
clsThis 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
clsargument so that you can inherit from it.Note that this is also called for the voucher bulk creation form, which is executed in an asynchronous context. For the bulk creation form,
save()is not called. Instead, you can implementpost_bulk_save(saved_vouchers)which may be called multiple times for every batch persisted to the database.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.control.signals.voucher_form_html = <pretix.base.signals.EventPluginSignal object>
Arguments: ‘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
formkeyword argument.As with all event plugin signals, the
senderkeyword argument will contain the event.
- pretix.control.signals.voucher_form_validation = <pretix.base.signals.EventPluginSignal object>
Arguments: ‘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
formargument and the current data state in thedataargument.As with all event plugin signals, the
senderkeyword argument will contain the event.
Dashboards¶
- pretix.control.signals.event_dashboard_top = <pretix.base.signals.EventPluginSignal object>
Arguments: ‘request’
This signal is sent out to include custom HTML in the top part of the the event dashboard. Receivers should return HTML.
As with all event plugin signals, the
senderkeyword argument will contain the event. An additional keyword argumentsubeventcan contain a sub-event.
- pretix.control.signals.event_dashboard_widgets = <pretix.base.signals.EventPluginSignal object>
This signal is sent out to include widgets in the event 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)
As with all event plugin signals, the
senderkeyword argument will contain the event. An additional keyword argumentsubeventcan contain a sub-event.
- pretix.control.signals.user_dashboard_widgets = <pretix.base.signals.GlobalSignal object>
Arguments: ‘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).
Ticket designs¶
- pretix.base.signals.layout_image_variables = <pretix.base.signals.EventPluginSignal object>
This signal is sent out to collect variables that can be used to display dynamic images in ticket-related PDF layouts. Receivers are expected to return a dictionary with globally unique identifiers as keys and more dictionaries as values that contain keys like in the following example:
1return { 2 "profile": { 3 "label": _("Profile picture"), 4 "evaluate": lambda orderposition, order, event: ContentFile(b"some-image-data"), 5 "etag": lambda orderposition, order, event: hash(b"some-image-data") 6 } 7}
The
evaluatemember will be called with the order position, order and event as arguments. The event might also be a subevent, if applicable. The return value ofevaluateshould be an instance of Django’sFileclass and point to a valid JPEG or PNG file. If no image is available,evaluateshould returnNone.The
etagmember will be called with the same arguments asevaluatebut should return astrvalue uniquely identifying the version of the file. This can be a hash of the file, but can also be something else. If no image is available,etagshould returnNone. In some cases, this can speed up the implementation.
- pretix.base.signals.layout_text_variables = <pretix.base.signals.EventPluginSignal object>
This signal is sent out to collect variables that can be used to display text in ticket-related PDF layouts. Receivers are expected to return a dictionary with globally unique identifiers as keys and more dictionaries as values that contain keys like in the following example:
1return { 2 "product": { 3 "label": _("Product name"), 4 "editor_sample": _("Sample product"), 5 "evaluate": lambda orderposition, order, event: str(orderposition.item), 6 "evaluate_bulk": lambda orderpositions: [str(op.item) for op in orderpositions], 7 } 8}
The
evaluatemember will be called with the order position, order and event as arguments. The event might also be a subevent, if applicable.The
evaluate_bulkmember is optional but can significantly improve performance in some situations because you can perform database fetches in bulk instead of single queries for every position.
- pretix.plugins.ticketoutputpdf.signals.override_layout = <pretix.base.signals.EventPluginSignal object>¶
Arguments:
layout,orderpositionThis signal allows you to forcefully override the ticket layout that is being used to create the ticket PDF. Use with care, as this will render any specifically by the organizer selected templates useless.
The
layoutkeyword argument will contain the layout which has been originally selected by the system, theorderpositionkeyword argument will contain theOrderPositionwhich is being generated.If you implement this signal and do not want to override the layout, make sure to return the
layoutkeyword argument which you have been passed.As with all event plugin signals, the
senderkeyword will contain the event.
API¶
- pretix.base.signals.api_event_settings_fields = <pretix.base.signals.EventPluginSignal object>
This signal is sent out to collect serializable settings fields for the API. You are expected to return a dictionary mapping names of attributes in the settings store to DRF serializer field instances.
As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.base.signals.validate_event_settings = <pretix.base.signals.EventPluginSignal object>
Arguments:
settings_dictThis signal is sent out if the user performs an update of event settings through the API or web interface. You are passed a
settings_dictdictionary with the new state of the event settings object and are expected to raise adjango.core.exceptions.ValidationErrorif the new state is not valid. You can not modify the dictionary. This is only recommended to use if you have multiple settings that can only be validated together. To validate individual settings, pass a validator to the serializer field instead.As with all event-plugin signals, the
senderkeyword argument will contain the event.
- pretix.api.signals.order_api_details = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderThis signal is sent out to fill the
plugin_detailsfield of the order API. Receivers should return a dictionary that is combined with the dictionaries of all other plugins. Note that doing database or network queries in receivers to this signal is discouraged and could cause serious performance issues. The main purpose is to provide information from e.g.meta_infoto the API consumer,
- pretix.api.signals.orderposition_api_details = <pretix.base.signals.EventPluginSignal object>
Arguments:
orderpositionThis signal is sent out to fill the
plugin_detailsfield of the order API. Receivers should return a dictionary that is combined with the dictionaries of all other plugins. Note that doing database or network queries in receivers to this signal is discouraged and could cause serious performance issues. The main purpose is to provide information from e.g.meta_infoto the API consumer,
- pretix.api.signals.register_device_security_profile = <pretix.base.signals.GlobalSignal object>
This signal is sent out to get all known device security_profiles. Receivers should return an instance of a subclass of
pretix.api.auth.devicesecurity.BaseSecurityProfileor a list of such instances.