Core Modules Reference

This section documents the core modules of the unified eventyay system.

Configuration & Settings

Settings Management

eventyay.config.settings_helpers.build_db_tls_config(config, db_backend)
eventyay.config.settings_helpers.build_redis_tls_config(config)

Channels & Sales

Sales Channels

class eventyay.base.channels.SalesChannel

Bases: object

property icon: str

The name of a Font Awesome icon to represent this channel

property identifier: str

The internal identifier of this sales channel.

property payment_restrictions_supported: bool

If this property is True, organizers can restrict the usage of payment providers to this sales channel.

Example: pretixPOS provides its own sales channel, ignores the configured payment providers completely and handles payments locally. Therefor, this property should be set to False for the pretixPOS sales channel as the event organizer cannot restrict the usage of any payment provider through the backend.

property testmode_supported: bool

Indication, if a saleschannels supports test mode orders

property unlimited_products_per_order: bool

If this property is True, purchases made using this sales channel are not limited to the maximum amount of items defined in the event settings.

property verbose_name: str

A human-readable name of this sales channel.

eventyay.base.channels.get_all_sales_channels()

The default sales channel is:

class eventyay.base.channels.WebshopSalesChannel

Bases: SalesChannel

icon = 'globe'
identifier = 'web'
verbose_name = 'Online shop'

Authentication & Authorization

Auth Backends

class eventyay.base.auth.BaseAuthBackend

Bases: object

This base class defines the interface that needs to be implemented by every class that supplies an authentication method to eventyay. Please note that eventyay authentication backends are different from plain Django authentication backends! Be sure to read the documentation chapter on authentication backends before you implement one.

authentication_url(request)

This method will be called to populate the URL for your authentication method’s tab on the login page. For example, if your method works through OAuth, you could return the URL of the OAuth authorization URL the user needs to visit.

If you return None (the default), the link will point to a page that shows the form defined by login_form_fields.

form_authenticate(request, form_data)

This method will be called after the user filled in the login form. request will contain the current request and form_data the input for the form fields defined in login_form_fields. You are expected to either return a User object (if login was successful) or None.

get_next_url(request)

This method will be called after a successful login to determine the next URL. Eventyay in general uses the 'next' query parameter. However, external authentication methods could use custom attributes with hardcoded names for security purposes. For example, OAuth uses 'state' for keeping track of application state.

property identifier

A short and unique identifier for this authentication backend. This should only contain lowercase letters and in most cases will be the same as your package name.

property login_form_fields: dict

This property may return form fields that the user needs to fill in to log in.

request_authenticate(request)

This method will be called when the user opens the login form. If the user already has a valid session according to your login mechanism, for example a cookie set by a different system or HTTP header set by a reverse proxy, you can directly return a User object that will be logged in.

request will contain the current request. You are expected to either return a User object (if login was successful) or None.

property verbose_name

A human-readable name of this authentication backend.

property visible

Whether or not this backend can be selected by users actively. Set this to False if you only implement request_authenticate.

class eventyay.base.auth.NativeAuthBackend

Bases: BaseAuthBackend

form_authenticate(request, form_data)

This method will be called after the user filled in the login form. request will contain the current request and form_data the input for the form fields defined in login_form_fields. You are expected to either return a User object (if login was successful) or None.

identifier = 'native'
property login_form_fields: dict

This property may return form fields that the user needs to fill in to log in.

property verbose_name

A human-readable name of this authentication backend.

eventyay.base.auth.get_auth_backends()

User Management

class eventyay.base.models.User(*args, **kwargs)

Bases: PermissionsMixin, LoggingMixin, RulesModelMixin, VersionedModel, GenerateCode, FileCleanupMixin, AbstractBaseUser

This is the unified user model used by eventyay for both authentication and video/event functionality.

Parameters:
  • email (str) – The user’s email address, used for identification.

  • fullname (str) – The user’s full name. May be empty or null.

  • is_active (bool) – Whether this user account is activated.

  • is_staff (bool) – True for system operators.

  • date_joined (datetime) – The datetime of the user’s registration.

  • locale (str) – The user’s preferred locale code.

  • timezone (str) – The user’s preferred timezone.

exception DoesNotExist

Bases: ObjectDoesNotExist

EMAIL_FIELD = 'email'
class ModerationState(value)

Bases: TextChoices

BANNED = 'banned'
NONE = ''
SILENCED = 'silenced'
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

REQUIRED_FIELDS = []
USERNAME_FIELD = 'email'
class UserType(value)

Bases: TextChoices

ANONYMOUS = 'anon'
KIOSK = 'kiosk'
PERSON = 'person'
property all_logentries
answers

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

api_oauthaccesstoken

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

api_oauthapplication

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

api_oauthgrant

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

api_oauthidtoken

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

api_oauthrefreshtoken

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

assigned_reviews

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

audit_logs

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

auth_backend

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

auth_token

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

avatar

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

avatar_license

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

avatar_source

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

avatar_thumbnail

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

avatar_thumbnail_tiny

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

avatar_url
bbb_invites

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

blocked_by

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

blocked_users

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

change_password(new_password)
chat_channels

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

chat_events

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

chat_notifications

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

chat_reactions

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

clear_caches()
client_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

client_state

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_joined

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

deleted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

emailaddress_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

emailqueue_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

event

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

event_grants

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

event_id
event_profile(event)

Retrieve (and/or create) the event.

SpeakerProfile for this user.

Retval:

eventyay.base.models.profile.EventProfile

event_views

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

eventyay_log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

exhibitor_answered_contact_requests

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

exhibitor_contact_requests

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

exhibitor_staff

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

exhibitor_views

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

feedback

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

fullname

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_active_staff_session(session_key=None)
get_avatar_url(event=None, thumbnail=None)

Returns the full avatar URL, where user.avatar_url returns the absolute URL.

get_display_name() str

Returns a user’s name or ‘Unnamed user’.

get_event_permission_set(organizer, event) set

Gets a set of permissions (as strings) that a user holds for a particular event

Parameters:
  • organizer – The organizer of the event

  • event – The event to check

Returns:

set

get_events_with_any_permission(request=None)

Returns a queryset of events the user has any permissions to.

Parameters:

request – The current request (optional). Required to detect staff sessions properly.

Returns:

Iterable of Events

get_events_with_permission(permission, request=None)

Returns a queryset of events the user has a specific permissions to.

Parameters:

request – The current request (optional). Required to detect staff sessions properly.

Returns:

Iterable of Events

get_full_name() str

Returns the first of the following user properties that is found to exist:

  • Full name

  • Wikimedia username

  • Email address

get_gravatar

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_locale_display(*, field=<django.db.models.fields.CharField: locale>)
get_locale_for_event(event)
get_moderation_state_display(*, field=<django.db.models.fields.CharField: moderation_state>)
get_next_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=True, **kwargs)
get_organizer_permission_set(organizer) set

Gets a set of permissions (as strings) that a user holds for a particular organizer

Parameters:

organizer – The organizer of the event

Returns:

set

get_organizers_with_permission(permission, request=None)

Returns a queryset of organizers the user has a specific permissions to.

Parameters:

request – The current request (optional). Required to detect staff sessions properly.

Returns:

Iterable of Organizers

get_password_reset_url(event=None, orga=False)
get_permissions_for_event(event) set

Returns a set of all permission a user has for the given event.

get_previous_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=False, **kwargs)
get_role_grants(room=None)
async get_role_grants_async(room=None)
get_session_auth_hash()

Return an HMAC that needs to

get_short_name() str

Returns the first of the following user properties that is found to exist:

  • Full name

  • Email address

Only present for backwards compatibility

get_type_display(*, field=<django.db.models.fields.CharField: type>)
gravatar_parameter
groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

guid
has_active_staff_session(session_key=None)

Returns whether or not a user has an active staff session (formerly known as superuser session) with the given session key.

has_avatar
has_event_permission(organizer, event, perm_name=None, request=None) bool

Checks if this user is part of any team that grants access of type perm_name to the event event.

Parameters:
  • organizer – The organizer of the event

  • event – The event to check

  • perm_name – The permission, e.g. can_change_teams

  • request – The current request (optional). Required to detect staff sessions properly.

Returns:

bool

has_organizer_permission(organizer, perm_name=None, request=None)

Checks if this user is part of any team that grants access of type perm_name to the organizer organizer.

Parameters:
  • organizer – The organizer to check

  • perm_name – The permission, e.g. can_change_teams

  • request – The current request (optional). Required to detect staff sessions properly.

Returns:

bool

has_perm(perm: str, obj: Self | None = None) bool

Return True if the user has the specified permission. Query all available auth backends, but return immediately if any backend returns True. Thus, a user who has permission from a single auth backend is assumed to have permission in general. If an object is provided, check permissions for that object.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_active

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_administrator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property is_banned
async is_blocked_in_channel_async(channel)
async is_member_of_channel_async(channel_id)
property is_silenced
is_staff

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_superuser

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_login

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

locale

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

log_action(action: str, data: dict = None, user=None, person=None, orga: bool = False)

Create a log entry for this user.

Parameters:
  • action – The log action that took place.

  • data – Addition data to be saved.

  • person (User) – The person modifying this user. Defaults to this user.

  • orga – Was this action initiated by a privileged user?

log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

logentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

logged_actions()

Returns all log entries that were made about this user.

mails

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

moderated_questions

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

moderation_state

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property name
nick

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

notification_settings: QuerySet[NotificationSetting]

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

notifications_send

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

notifications_token

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects: UserManager = <django.db.models.manager.UserManagerFromUserQuerySet object>
own_actions()

Returns all log entries that were made by this user.

password

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

poll_votes

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

poster_presenter

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

poster_votes

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

pretalx_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

profile

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

profiles

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

pw_reset_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pw_reset_token

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

question_votes

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

questions

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

regenerate_token() Token

Generates a new API access token, deleting the old one.

require_2fa

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

requiredaction_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

reset_password(event, user=None, mail_text=None, orga=False)
reviews

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

room_grants

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

roulette_pairing_left

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

roulette_pairing_right

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

rouletterequest_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

send_password_reset(request: HttpRequest)
send_security_notice(messages, email=None)
serialize_public(include_admin_info=False, trait_badges_map=None, include_client_state=False)

Serialize user for public display in video/event context

session_token

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

show_publicly

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

social_login_id_linkedin

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

social_login_id_twitter

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

socialaccount_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

soft_delete()

Soft delete for video/event functionality

speaker_roles

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

staffsession_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

staffsessionauditlog_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

staticdevice_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

submission_comments

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

submission_favorites

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

submission_favourites

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

submissions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

teams

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

timezone

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

token_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property top_logentries
totpdevice_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

traits

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

u2fdevice_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

update_session_token()
user_permissions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

views

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

webauthndevice_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

wikimedia_username

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Permissions

class eventyay.core.permissions.Permission(value)

Bases: Enum

EVENT_ANNOUNCE = 'event:announce'
EVENT_API = 'event:api'
EVENT_CHAT_DIRECT = 'event:chat.direct'
EVENT_CONNECTIONS_UNLIMITED = 'event:connections.unlimited'
EVENT_EXHIBITION_CONTACT = 'event:exhibition.contact'
EVENT_GRAPHS = 'event:graphs'
EVENT_ROOMS_CREATE_BBB = 'event:rooms.create.bbb'
EVENT_ROOMS_CREATE_CHAT = 'event:rooms.create.chat'
EVENT_ROOMS_CREATE_EXHIBITION = 'event:rooms.create.exhibition'
EVENT_ROOMS_CREATE_POSTER = 'event:rooms.create.poster'
EVENT_ROOMS_CREATE_STAGE = 'event:rooms.create.stage'
EVENT_SECRETS = 'event:secrets'
EVENT_UPDATE = 'event.update'
EVENT_USERS_LIST = 'event:users.list'
EVENT_USERS_MANAGE = 'event:users.manage'
EVENT_VIEW = 'event.view'
ROOM_ANNOUNCE = 'room:announce'
ROOM_BBB_JOIN = 'room:bbb.join'
ROOM_BBB_MODERATE = 'room:bbb.moderate'
ROOM_BBB_RECORDINGS = 'room:bbb.recordings'
ROOM_CHAT_JOIN = 'room:chat.join'
ROOM_CHAT_MODERATE = 'room:chat.moderate'
ROOM_CHAT_READ = 'room:chat.read'
ROOM_CHAT_SEND = 'room:chat.send'
ROOM_DELETE = 'room:delete'
ROOM_INVITE = 'room:invite'
ROOM_INVITE_ANONYMOUS = 'room:invite.anonymous'
ROOM_JANUSCALL_JOIN = 'room:januscall.join'
ROOM_JANUSCALL_MODERATE = 'room:januscall.moderate'
ROOM_POLL_EARLY_RESULTS = 'room:poll.early_results'
ROOM_POLL_MANAGE = 'room:poll.manage'
ROOM_POLL_READ = 'room:poll.read'
ROOM_POLL_VOTE = 'room:poll.vote'
ROOM_QUESTION_ASK = 'room:question.ask'
ROOM_QUESTION_MODERATE = 'room:question.moderate'
ROOM_QUESTION_READ = 'room:question.read'
ROOM_QUESTION_VOTE = 'room:question.vote'
ROOM_ROULETTE_JOIN = 'room:roulette.join'
ROOM_UPDATE = 'room:update'
ROOM_VIEW = 'room:view'
ROOM_VIEWERS = 'room:viewers'
ROOM_ZOOM_JOIN = 'room:zoom.join'
class eventyay.control.permissions.AdministratorPermissionRequiredMixin

Bases: object

This mixin is equivalent to the administrator_permission_required view decorator but is in a form suitable for class-based views.

classmethod as_view(**initkwargs)
class eventyay.control.permissions.EventPermissionRequiredMixin

Bases: object

This mixin is equivalent to the event_permission_required view decorator but is in a form suitable for class-based views.

classmethod as_view(**initkwargs)
permission = ''
class eventyay.control.permissions.OrganizerPermissionRequiredMixin

Bases: object

This mixin is equivalent to the organizer_permission_required view decorator but is in a form suitable for class-based views.

classmethod as_view(**initkwargs)
permission = ''
class eventyay.control.permissions.StaffMemberRequiredMixin

Bases: object

This mixin is equivalent to the staff_memer_required view decorator but is in a form suitable for class-based views.

classmethod as_view(**initkwargs)
eventyay.control.permissions.administrator_permission_required()

This view decorator rejects all requests with a 403 response which are not from users with a current staff member session.

eventyay.control.permissions.current_url(request)
eventyay.control.permissions.event_permission_required(permission)

This view decorator rejects all requests with a 403 response which are not from users having the given permission for the event the request is associated with.

eventyay.control.permissions.organizer_permission_required(permission)

This view decorator rejects all requests with a 403 response which are not from users having the given permission for the event the request is associated with.

eventyay.control.permissions.staff_member_required()

This view decorator rejects all requests with a 403 response which are not staff members (but do not need to have an active session).

Payment Processing

Base Payment Provider

class eventyay.base.payment.BasePaymentProvider(event: Event)

Bases: object

This is the base class for all payment providers.

property abort_pending_allowed: bool

Whether or not a user can abort a payment in pending state to switch to another payment method. This returns False by default which is no guarantee that aborting a pending payment can never happen, it just hides the frontend button to avoid users accidentally committing double payments.

api_payment_details(payment: OrderPayment)

Will be called to populate the details parameter of the payment in the REST API.

Parameters:

payment – The payment in question.

Returns:

A serializable dictionary

calculate_fee(price: Decimal) Decimal

Calculate the fee for this payment provider which will be added to final price before fees (but after taxes). It should include any taxes. The default implementation makes use of the setting _fee_abs for an absolute fee and _fee_percent for a percentage.

Parameters:

price – The total value without the payment method fee, after taxes.

cancel_payment(payment: OrderPayment)

Will be called to cancel a payment. The default implementation just sets the payment state to canceled, but in some cases you might want to notify an external provider.

On success, you should set payment.state = OrderPayment.PAYMENT_STATE_CANCELED (or call the super method). On failure, you should raise a PaymentException.

checkout_confirm_render(request, order: Order = None) str

If the user has successfully filled in their payment data, they will be redirected to a confirmation page which lists all details of their order for a final review. This method should return the HTML which should be displayed inside the ‘Payment’ box on this page.

In most cases, this should include a short summary of the user’s input and a short explanation on how the payment process will continue.

Parameters:

order – Only set when this is a change to a new payment method for an existing order.

checkout_prepare(request: HttpRequest, cart: Dict[str, Any]) bool | str

Will be called after the user selects this provider as their payment method. If you provided a form to the user to enter payment data, this method should at least store the user’s input into their session.

This method should return False if the user’s input was invalid, True if the input was valid and the frontend should continue with default behavior or a string containing a URL if the user should be redirected somewhere else.

On errors, you should use Django’s message framework to display an error message to the user (or the normal form validation error messages).

The default implementation stores the input into the form returned by payment_form() in the user’s session.

If your payment method requires you to redirect the user to an external provider, this might be the place to do so.

Important

If this is called, the user has not yet confirmed their order. You may NOT do anything which actually moves money.

Parameters:

cart

This dictionary contains at least the following keys:

positions:

A list of CartPosition objects that are annotated with the special attributes count and total because multiple objects of the same content are grouped into one.

raw:

The raw list of CartPosition objects in the users cart

total:

The overall total including the fee for the payment method.

payment_fee:

The fee for the payment method.

execute_payment(request: HttpRequest, payment: OrderPayment) str

After the user has confirmed their purchase, this method will be called to complete the payment process. This is the place to actually move the money if applicable. You will be passed an pretix.base.models.OrderPayment object that contains the amount of money that should be paid.

If you need any special behavior, you can return a string containing the URL the user will be redirected to. If you are done with your process you should return the user to the order’s detail page.

If the payment is completed, you should call payment.confirm(). Please note that this might raise a Quota.QuotaExceededException if (and only if) the payment term of this order is over and some of the items are sold out. You should use the exception message to display a meaningful error to the user.

The default implementation just returns None and therefore leaves the order unpaid. The user will be redirected to the order’s detail page by default.

On errors, you should raise a PaymentException.

Parameters:
  • order – The order object

  • payment – An OrderPayment instance

execute_refund(refund: OrderRefund)

Will be called to execute an refund. Note that refunds have an amount property and can be partial.

This should transfer the money back (if possible). On success, you should call refund.done(). On failure, you should raise a PaymentException.

property identifier: str

A short and unique identifier for this payment provider. This should only contain lowercase letters and in most cases will be the same as your package name.

is_allowed(request: HttpRequest, total: Decimal = None) bool

You can use this method to disable this payment provider for certain groups of users, products or other criteria. If this method returns False, the user will not be able to select this payment method. This will only be called during checkout, not on retrying.

The default implementation checks for the _availability_date setting to be either unset or in the future and for the _total_max and _total_min requirements to be met. It also checks the _restrict_countries and _restrict_to_sales_channels setting.

Parameters:

total – The total value without the payment method fee, after taxes.

Changed in version 1.17.0: The total parameter has been added. For backwards compatibility, this method is called again without this parameter if it raises a TypeError on first try.

property is_enabled: bool

Returns whether or whether not this payment provider is enabled. By default, this is determined by the value of the _enabled setting.

is_implicit(request: HttpRequest) bool

Returns whether or whether not this payment provider is an “implicit” payment provider that will always and unconditionally be used if is_allowed() returns True and does not require any input. This is intended to be used by the FreeOrderProvider, which skips the payment choice page. By default, this returns False. Please do not set this if you don’t know exactly what you are doing.

property is_meta: bool

Returns whether or whether not this payment provider is a “meta” payment provider that only works as a settings holder for other payment providers and should never be used directly. This is a trick to implement payment gateways with multiple payment methods but unified payment settings. Take a look at the built-in stripe provider to see how this might be used. By default, this returns False.

matching_id(payment: OrderPayment)

Will be called to get an ID for matching this payment when comparing pretix records with records of an external source. This should return the main transaction ID for your API.

Parameters:

payment – The payment in question.

Returns:

A string or None

new_refund_control_form_process(request: HttpRequest, amount: Decimal, order: Order) OrderRefund

Process a backend user’s request to initiate a new refund with an amount of amount for order.

This method should parse the input provided to the form created and either raise ValidationError or return an OrderRefund object in created state that has not yet been saved to the database. The system will then call execute_refund on that object.

new_refund_control_form_render(request: HttpRequest, order: Order) str

Render a form that will be shown to backend users when trying to create a new refund.

Usually, refunds are created from an existing payment object, e.g. if there is a credit card payment and the credit card provider returns True from payment_refund_supported, the system will automatically create an OrderRefund and call execute_refund on that payment. This method can and should not be used in that situation! Instead, by implementing this method you can add a refund flow for this payment provider that starts without an existing payment. For example, even though an order was paid by credit card, it could easily be refunded by SEPA bank transfer. In that case, the SEPA bank transfer provider would implement this method and return a form that asks for the IBAN.

This method should return HTML or None. All form fields should have a globally unique name.

order_change_allowed(order: Order) bool

Will be called to check whether it is allowed to change the payment method of an order to this one.

The default implementation checks for the _availability_date setting to be either unset or in the future, as well as for the _total_max, _total_min and _restricted_countries settings.

Parameters:

order – The order object

order_pending_mail_render(order: Order, payment: OrderPayment) str

After the user has submitted their order, they will receive a confirmation email. You can return a string from this method if you want to add additional information to this email.

Parameters:
  • order – The order object

  • payment – The payment object

payment_control_render(request: HttpRequest, payment: OrderPayment) str

Will be called if the event administrator views the details of a payment.

It should return HTML code containing information regarding the current payment status and, if applicable, next steps.

The default implementation returns an empty string.

Parameters:

order – The order object

payment_control_render_short(payment: OrderPayment) str

Will be called if the event administrator performs an action on the payment. Should return a very short version of the payment method. Usually, this should return e.g. a transaction ID or account identifier, but no information on status, dates, etc.

The default implementation falls back to payment_presale_render.

Parameters:

order – The order object

payment_form(request: HttpRequest) Form

This is called by the default implementation of payment_form_render() to obtain the form that is displayed to the user during the checkout process. The default implementation constructs the form using payment_form_fields and sets appropriate prefixes for the form and all fields and fills the form with data form the user’s session.

If you overwrite this, we strongly suggest that you inherit from PaymentProviderForm (from this module) that handles some nasty issues about required fields for you.

payment_form_class

alias of PaymentProviderForm

property payment_form_fields: dict

This is used by the default implementation of payment_form(). It should return an object similar to settings_form_fields.

The default implementation returns an empty dictionary.

payment_form_render(request: HttpRequest, total: Decimal, order: Order = None) str

When the user selects this provider as their preferred payment method, they will be shown the HTML you return from this method.

The default implementation will call payment_form() and render the returned form. If your payment method doesn’t require the user to fill out form fields, you should just return a paragraph of explanatory text.

Parameters:

order – Only set when this is a change to a new payment method for an existing order.

payment_is_valid_session(request: HttpRequest) bool

This is called at the time the user tries to place the order. It should return True if the user’s session is valid and all data your payment provider requires in future steps is present.

payment_partial_refund_supported(payment: OrderPayment) bool

Will be called to check if the provider supports automatic partial refunding for this payment.

payment_pending_render(request: HttpRequest, payment: OrderPayment) str

Render customer-facing instructions on how to proceed with a pending payment

Returns:

HTML

payment_prepare(request: HttpRequest, payment: OrderPayment) bool | str

Will be called if the user retries to pay an unpaid order (after the user filled in e.g. the form returned by payment_form()) or if the user changes the payment method.

It should return and report errors the same way as checkout_prepare(), but receives an Order object instead of a cart object.

Note: The Order object given to this method might be different from the version stored in the database as it’s total will already contain the payment fee for the new payment method.

payment_presale_render(payment: OrderPayment) str

Will be called if the ticket customer views the details of a payment. This is currently used e.g. when the customer requests a refund to show which payment method is used for the refund. This should only include very basic information about the payment, such as “VISA card ****9999”, and never raw payment information.

The default implementation returns the public name of the payment provider.

Parameters:

order – The order object

payment_refund_supported(payment: OrderPayment) bool

Will be called to check if the provider supports automatic refunding for this payment.

property priority: int

Returns a priority that is used for sorting payment providers. Higher priority means higher up in the list. Default to 100. Providers with same priority are sorted alphabetically.

property public_name: str

A human-readable name for this payment provider to be shown to the public. This should be short but self-explaining. Good examples include ‘Bank transfer’ and ‘Credit card’, but ‘Credit card via Stripe’ might be to explicit. By default, this is the same as verbose_name

refund_control_render(request: HttpRequest, refund: OrderRefund) str

Will be called if the event administrator views the details of a refund.

It should return HTML code containing information regarding the current refund status and, if applicable, next steps.

The default implementation returns an empty string.

Parameters:

refund – The refund object

render_invoice_text(order: Order, payment: OrderPayment) str

This is called when an invoice for an order with this payment provider is generated. The default implementation returns the content of the _invoice_text configuration variable (an I18nString), or an empty string if unconfigured. For paid orders, the default implementation always renders a string stating that the invoice is already paid.

property requires_invoice_immediately

Return whether this payment method requires an invoice to exist for an order, even though the event is configured to only create invoices for paid orders. By default this is False, but it might be overwritten for e.g. bank transfer. execute_payment is called after the invoice is created.

settings_content_render(request: HttpRequest) str

When the event’s administrator visits the event configuration page, this method is called. It may return HTML containing additional information that is displayed below the form fields configured in settings_form_fields.

settings_form_clean(cleaned_data)

Overriding this method allows you to inject custom validation into the settings form.

Parameters:

cleaned_data – Form data as per previous validations.

Returns:

Please return the modified cleaned_data

property settings_form_fields: dict

When the event’s administrator visits the event configuration page, this method is called to return the configuration fields available.

It should therefore return a dictionary where the keys should be (unprefixed) settings keys and the values should be corresponding Django form fields.

The default implementation returns the appropriate fields for the _enabled, _fee_abs, _fee_percent and _availability_date settings mentioned above.

We suggest that you return an OrderedDict object instead of a dictionary and make use of the default implementation. Your implementation could look like this:

 1@property
 2def settings_form_fields(self):
 3    return OrderedDict(
 4        list(super().settings_form_fields.items()) + [
 5            ('bank_details',
 6             forms.CharField(
 7                 widget=forms.Textarea,
 8                 label=_('Bank account details'),
 9                 required=False
10             ))
11        ]
12    )

Warning

It is highly discouraged to alter the _enabled field of the default implementation.

shred_payment_info(obj: OrderPayment | OrderRefund)

When personal data is removed from an event, this method is called to scrub payment-related data from a payment or refund. By default, it removes all info from the info attribute. You can override this behavior if you want to retain attributes that are not personal data on their own, i.e. a reference to a transaction in an external system. You can also override this to scrub more data, e.g. data from external sources that is saved in LogEntry objects or other places.

Parameters:

order – An order

property test_mode_message: str

If this property is set to a string, this will be displayed when this payment provider is selected while the event is in test mode. You should use it to explain to your user how your plugin behaves, e.g. if it falls back to a test mode automatically as well or if actual payments will be performed.

If you do not set this (or, return None), pretix will show a default message warning the user that this plugin does not support test mode payments.

property verbose_name: str

A human-readable name for this payment provider. This should be short but self-explaining. Good examples include ‘Bank transfer’ and ‘Credit card via Stripe’.

Payment Exceptions

exception eventyay.base.payment.PaymentException

Bases: Exception

Invoice Generation

See eventyay.base.services.invoices for invoice generation functions.

Ticket Output

Ticket Output Providers

class eventyay.base.ticketoutput.BaseTicketOutput(event: Event)

Bases: object

This is the base class for all ticket outputs.

property download_button_icon: str

The Font Awesome icon on the download button in the frontend.

property download_button_text: str

The text on the download button in the frontend.

generate(position: OrderPosition) Tuple[str, str, str]

This method should generate the download file and return a tuple consisting of a filename, a file type and file content. The extension will be taken from the filename which is otherwise ignored.

Alternatively, you can pass a tuple consisting of an arbitrary string, text/uri-list and a single URL. In this case, the user will be redirected to this link instead of being asked to download a generated file.

Note

If the event uses the event series feature (internally called subevents) and your generated ticket contains information like the event name or date, you probably want to display the properties of the subevent. A common pattern to do this would be a declaration ev = position.subevent or position.order.event and then access properties that are present on both classes like ev.name or ev.date_from.

Note

Should you elect to use the URI redirection feature instead of offering downloads, you should also set the multi_download_enabled-property to False.

generate_order(order: Order) Tuple[str, str, str]

This method is the same as order() but should not generate one file per order position but instead one file for the full order.

This method is optional to implement. If you don’t implement it, the default implementation will offer a zip file of the generate() results for the order positions.

This method should generate a download file and return a tuple consisting of a filename, a file type and file content. The extension will be taken from the filename which is otherwise ignored.

If you override this method, make sure that positions that are addons (i.e. addon_to is set) are only outputted if the event setting ticket_download_addons is active. Do the same for positions that are non-admission without ticket_download_nonadm active. If you want, you can just iterate over order.positions_with_tickets which applies the appropriate filters for you.

property identifier: str

A short and unique identifier for this ticket output. This should only contain lowercase letters and in most cases will be the same as your package name.

property is_enabled: bool

Returns whether or whether not this output is enabled. By default, this is determined by the value of the _enabled setting.

property javascript_required: bool

If this property is set to true, the download-button for this ticket-type will not be displayed when the user’s browser has JavaScript disabled.

Defaults to False

property long_download_button_text: str

The text on the large download button in the frontend.

property multi_download_button_text: str

The text on the multi download button in the frontend.

property multi_download_enabled: bool

Returns whether or not the generate_order method may be called. Returns True by default.

property preview_allowed: bool

By default, the generate() method is called for generating a preview in the pretix backend. In case your plugin cannot generate previews for any reason, you can manually disable it here.

settings_content_render(request: HttpRequest) str

When the event’s administrator visits the event configuration page, this method is called. It may return HTML containing additional information that is displayed below the form fields configured in settings_form_fields.

property settings_form_fields: dict

When the event’s administrator visits the event configuration page, this method is called to return the configuration fields available.

It should therefore return a dictionary where the keys should be (unprefixed) settings keys and the values should be corresponding Django form fields.

The default implementation returns the appropriate fields for the _enabled setting mentioned above.

We suggest that you return an OrderedDict object instead of a dictionary and make use of the default implementation. Your implementation could look like this:

 1@property
 2def settings_form_fields(self):
 3    return OrderedDict(
 4        list(super().settings_form_fields.items()) + [
 5            ('paper_size',
 6             forms.CharField(
 7                 label=_('Paper size'),
 8                 required=False
 9             ))
10        ]
11    )

Warning

It is highly discouraged to alter the _enabled field of the default implementation.

property verbose_name: str

A human-readable name for this ticket output. This should be short but self-explanatory. Good examples include ‘PDF tickets’ and ‘Passbook’.

Data Export

Exporters

class eventyay.base.exporter.BaseExporter(event, progress_callback=<function BaseExporter.<lambda>>)

Bases: object

This is the base class for all data exporters

property export_form_fields: dict

When the event’s administrator visits the export page, this method is called to return the configuration fields available.

It should therefore return a dictionary where the keys should be field names and the values should be corresponding Django form fields.

We suggest that you return an OrderedDict object instead of a dictionary. Your implementation could look like this:

 1@property
 2def export_form_fields(self):
 3    return OrderedDict(
 4        [
 5            ('tab_width',
 6             forms.IntegerField(
 7                 label=_('Tab width'),
 8                 default=4
 9             ))
10        ]
11    )
property identifier: str

A short and unique identifier for this exporter. This should only contain lowercase letters and in most cases will be the same as your package name.

render(form_data: dict) Tuple[str, str, bytes]

Render the exported file and return a tuple consisting of a filename, a file type and file content.

Parameters:
  • form_data (dict) – The form data of the export details form

  • output_file – You can optionally accept a parameter that will be given a file handle to write the output to. In this case, you can return None instead of the file content.

Note: If you use a ModelChoiceField (or a ModelMultipleChoiceField), the form_data will not contain the model instance but only it’s primary key (or a list of primary keys) for reasons of internal serialization when using background tasks.

property verbose_name: str

A human-readable name for this exporter. This should be short but self-explaining. Good examples include ‘JSON’ or ‘Microsoft Excel’.

class eventyay.base.exporter.ListExporter(event, progress_callback=<function BaseExporter.<lambda>>)

Bases: BaseExporter

class ProgressSetTotal(total)

Bases: tuple

total

Alias for field number 0

property additional_form_fields: dict
property export_form_fields: dict

When the event’s administrator visits the export page, this method is called to return the configuration fields available.

It should therefore return a dictionary where the keys should be field names and the values should be corresponding Django form fields.

We suggest that you return an OrderedDict object instead of a dictionary. Your implementation could look like this:

 1@property
 2def export_form_fields(self):
 3    return OrderedDict(
 4        [
 5            ('tab_width',
 6             forms.IntegerField(
 7                 label=_('Tab width'),
 8                 default=4
 9             ))
10        ]
11    )
get_filename()
iterate_list(form_data)
render(form_data: dict, output_file=None) Tuple[str, str, bytes]

Render the exported file and return a tuple consisting of a filename, a file type and file content.

Parameters:
  • form_data (dict) – The form data of the export details form

  • output_file – You can optionally accept a parameter that will be given a file handle to write the output to. In this case, you can return None instead of the file content.

Note: If you use a ModelChoiceField (or a ModelMultipleChoiceField), the form_data will not contain the model instance but only it’s primary key (or a list of primary keys) for reasons of internal serialization when using background tasks.

class eventyay.base.exporter.MultiSheetListExporter(event, progress_callback=<function BaseExporter.<lambda>>)

Bases: ListExporter

property export_form_fields: dict

When the event’s administrator visits the export page, this method is called to return the configuration fields available.

It should therefore return a dictionary where the keys should be field names and the values should be corresponding Django form fields.

We suggest that you return an OrderedDict object instead of a dictionary. Your implementation could look like this:

 1@property
 2def export_form_fields(self):
 3    return OrderedDict(
 4        [
 5            ('tab_width',
 6             forms.IntegerField(
 7                 label=_('Tab width'),
 8                 default=4
 9             ))
10        ]
11    )
iterate_list(form_data)
iterate_sheet(form_data, sheet)
render(form_data: dict, output_file=None) Tuple[str, str, bytes]

Render the exported file and return a tuple consisting of a filename, a file type and file content.

Parameters:
  • form_data (dict) – The form data of the export details form

  • output_file – You can optionally accept a parameter that will be given a file handle to write the output to. In this case, you can return None instead of the file content.

Note: If you use a ModelChoiceField (or a ModelMultipleChoiceField), the form_data will not contain the model instance but only it’s primary key (or a list of primary keys) for reasons of internal serialization when using background tasks.

property sheets

Data Shredding

class eventyay.base.shredder.BaseDataShredder(event: Event)

Bases: object

This is the base class for all data shredders.

property description: str

A more detailed description of what this shredder does. Can contain HTML.

generate_files() List[Tuple[str, str, str]]

This method is called to export the data that is about to be shred and return a list of tuples consisting of a filename, a file type and file content.

You can also implement this as a generator and yield those tuples instead of returning a list of them.

property identifier: str

A short and unique identifier for this shredder. This should only contain lowercase letters and in most cases will be the same as your package name.

property require_download_confirmation

Indicates whether the data of this shredder needs to be downloaded, before it is actually shredded. By default this value is equal to the tax relevant flag.

shred_data()

This method is called to actually remove the data from the system. You should remove any database objects here.

You should never delete LogEntry objects, but you might modify them to remove personal data. In this case, set the LogEntry.shredded attribute to True to show that this is no longer original log data.

property tax_relevant

Indicates whether this removes potentially tax-relevant data.

property verbose_name: str

A human-readable name for what this shredder removes. This should be short but self-explanatory. Good examples include ‘E-Mail addresses’ or ‘Invoices’.

exception eventyay.base.shredder.ShredError(*args)

Bases: LazyLocaleException

eventyay.base.shredder.shred_constraints(event: Event)

Email & Notifications

Email Context

eventyay.base.email.get_email_context(**kwargs)
eventyay.base.email.get_available_placeholders(event: Event, base_parameters: Iterable[str]) dict[str, BaseMailTextPlaceholder]

Mail Services

exception eventyay.base.services.mail.SendMailException

Bases: Exception

Notification Services

class eventyay.base.notifications.ActionRequiredNotificationType(event: Event = None)

Bases: NotificationType

action_type = 'pretix.event.action_required'
build_notification(logentry: LogEntry)

This is the main function that you should override. It is supposed to turn a log entry object into a notification object that can then be rendered e.g. into an email.

required_permission = 'can_change_orders'
verbose_name = 'Administrative action required'
class eventyay.base.notifications.Notification(event: Event, title: str, detail: str = None, url: str = None)

Bases: object

Represents a notification that is sent/shown to a user. A notification consists of:

  • one event reference

  • one title text that is shown e.g. in the email subject or in a headline

  • optionally one detail text that may or may not be shown depending on the notification method

  • optionally one url that should be absolute and point to the context of an notification (e.g. an order)

  • optionally a number of attributes consisting of a title and a value that can be used to add additional details to the notification (e.g. “Customer: ABC”)

  • optionally a number of actions that may or may not be shown as buttons depending on the notification method, each consisting of a button label and an absolute URL to point to.

add_action(label, url)

Add an action to the notification, defined by a label and an url. An example could be a label of “View order” and an url linking to the order detail page.

add_attribute(title, value)

Add an attribute to the notification, defined by a title and a value. An example could be a title of “Date” and a value of “2017-12-14”.

class eventyay.base.notifications.NotificationAction(label, url)

Bases: tuple

label

Alias for field number 0

url

Alias for field number 1

class eventyay.base.notifications.NotificationAttribute(title, value)

Bases: tuple

title

Alias for field number 0

value

Alias for field number 1

class eventyay.base.notifications.NotificationType(event: Event = None)

Bases: object

property action_type: str

The action_type string that this notification handles, for example "pretix.event.order.paid". Only one notification type should be registered per action type.

build_notification(logentry: LogEntry) Notification

This is the main function that you should override. It is supposed to turn a log entry object into a notification object that can then be rendered e.g. into an email.

property required_permission: str

The permission a user needs to hold for the related event to receive this notification.

property verbose_name: str

A human-readable name of this notification type.

class eventyay.base.notifications.ParametrizedOrderNotificationType(event, action_type, verbose_name, title)

Bases: NotificationType

property action_type

The action_type string that this notification handles, for example "pretix.event.order.paid". Only one notification type should be registered per action type.

build_notification(logentry: LogEntry)

This is the main function that you should override. It is supposed to turn a log entry object into a notification object that can then be rendered e.g. into an email.

required_permission = 'can_view_orders'
property verbose_name

A human-readable name of this notification type.

eventyay.base.notifications.get_all_notification_types(event=None)
eventyay.base.notifications.register_default_notification_types(sender, **kwargs)

Middleware

class eventyay.base.middleware.CustomCommonMiddleware(get_response)

Bases: CommonMiddleware

get_full_path_with_slash(request)

Raise an error regardless of DEBUG mode when in POST, PUT, or PATCH.

class eventyay.base.middleware.LocaleMiddleware(get_response)

Bases: MiddlewareMixin

This middleware sets the correct locale and timezone for a request.

process_request(request: HttpRequest)
process_response(request: HttpRequest, response: HttpResponse)
class eventyay.base.middleware.SecurityMiddleware(get_response)

Bases: MiddlewareMixin

CSP_EXEMPT = ('/api/v1/docs/',)
process_response(request, resp)
eventyay.base.middleware.get_default_language()
eventyay.base.middleware.get_language_from_browser(request: HttpRequest) str
eventyay.base.middleware.get_language_from_event(request: HttpRequest) str
eventyay.base.middleware.get_language_from_request(request: HttpRequest) str

Analyzes the request to find what language the user wants the system to show. Only languages listed in settings.LANGUAGES are taken into account. If the user requests a sublanguage where we have a main language, we send out the main language.

eventyay.base.middleware.get_language_from_user_settings(request: HttpRequest) str
class eventyay.control.middleware.AuditLogMiddleware(get_response)

Bases: object

class eventyay.control.middleware.PermissionMiddleware(get_response=None)

Bases: object

This middleware enforces all requests to the control app to require login. Additionally, it enforces all requests to “control:event.” URLs to be for an event the user has basic access to.

EXCEPTIONS = ('auth.login', 'auth.login.2fa', 'auth.register', 'auth.forgot', 'auth.forgot.recover', 'auth.invite', 'user.settings.notifications.off', 'oauth2_provider')
EXCEPTIONS_2FA = ('eventyay_common:account.2fa', 'eventyay_common:account.2fa.add', 'eventyay_common:account.2fa.enable', 'eventyay_common:account.2fa.disable', 'eventyay_common:account.2fa.regenemergency', 'eventyay_common:account.2fa.confirm.totp', 'eventyay_common:account.2fa.confirm.webauthn', 'eventyay_common:account.2fa.delete', 'auth.logout', 'user.reauth')

Multi-domain middleware is located in eventyay.multidomain.middleware.

Internationalization

class eventyay.base.i18n.LazyCurrencyNumber(value, currency)

Bases: object

class eventyay.base.i18n.LazyDate(value)

Bases: object

class eventyay.base.i18n.LazyExpiresDate(expires)

Bases: object

exception eventyay.base.i18n.LazyLocaleException(*args)

Bases: Exception

class eventyay.base.i18n.LazyNumber(value, decimal_pos=2)

Bases: object

eventyay.base.i18n.get_babel_locale()
eventyay.base.i18n.get_language_without_region(lng=None)

Returns the currently active language, but strips what pretix calls a region. For example, if the currently active language is en-us, you will be returned en since pretix does not ship with separate language files for en-us. If the currently active language is pt-br, you will be returned pt-br since there are separate language files for pt-br.

tl;dr: You will be always passed a language that is defined in settings.LANGUAGES.

eventyay.base.i18n.language(lng, region=None)

Temporarily change the active language to lng. Will automatically be rolled back when the context manager returns.

You can optionally pass a “region”. For example, if you pass en as lng and US as region, the active language will be en-us, which will mostly affect date/time formatting. If you pass a lng that already contains a region, e.g. pt-br, the region attribute will be ignored.

eventyay.helpers.i18n.get_format_without_seconds(format_name)
eventyay.helpers.i18n.get_javascript_format(format_name)
eventyay.helpers.i18n.get_javascript_format_without_seconds(format_name)
eventyay.helpers.i18n.get_javascript_output_format(format_name)
eventyay.helpers.i18n.get_moment_locale(locale=None)
eventyay.helpers.i18n.i18ncomp(query)

Utilities

Money & Decimal

eventyay.base.decimal.round_decimal(dec, currency=None, places_dict={'BIF': 0, 'CLP': 0, 'DJF': 0, 'GNF': 0, 'JPY': 0, 'KMF': 0, 'KRW': 0, 'MGA': 0, 'PYG': 0, 'RWF': 0, 'VND': 0, 'VUV': 0, 'XAF': 0, 'XOF': 0, 'XPF': 0})
class eventyay.helpers.money.DecimalTextInput(*args, **kwargs)

Bases: TextInput

format_value(value)

Return a value as it should appear when rendered in a template.

property media
eventyay.helpers.money.change_decimal_field(field, currency)

Date & Time

class eventyay.base.reldate.ModelRelativeDateTimeField(*args, **kwargs)

Bases: CharField

form_class

alias of RelativeDateTimeField

formfield(**kwargs)

Return a django.forms.Field instance for this field.

from_db_value(value, expression, connection)
get_prep_value(value)

Perform preliminary non-db specific value checks and conversions.

to_python(value)

Convert the input value into the expected Python data type, raising django.core.exceptions.ValidationError if the data can’t be converted. Return the converted value. Subclasses should override this.

class eventyay.base.reldate.RelativeDate(days_before, minutes_before, time, base_date_name)

Bases: tuple

base_date_name

Alias for field number 3

days_before

Alias for field number 0

minutes_before

Alias for field number 1

time

Alias for field number 2

class eventyay.base.reldate.RelativeDateField(*args, **kwargs)

Bases: RelativeDateTimeField

clean(value)

Validate every value in the given list. A value is validated against the corresponding Field in self.fields.

For example, if this MultiValueField was instantiated with fields=(DateField(), TimeField()), clean() would call DateField.clean(value[0]) and TimeField.clean(value[1]).

compress(data_list)

Return a single value for the given list of values. The values can be assumed to be valid.

For example, if this MultiValueField was instantiated with fields=(DateField(), TimeField()), this might return a datetime object created by combining the date and time in data_list.

class eventyay.base.reldate.RelativeDateTimeField(*args, **kwargs)

Bases: MultiValueField

clean(value)

Validate every value in the given list. A value is validated against the corresponding Field in self.fields.

For example, if this MultiValueField was instantiated with fields=(DateField(), TimeField()), clean() would call DateField.clean(value[0]) and TimeField.clean(value[1]).

compress(data_list)

Return a single value for the given list of values. The values can be assumed to be valid.

For example, if this MultiValueField was instantiated with fields=(DateField(), TimeField()), this might return a datetime object created by combining the date and time in data_list.

set_event(event)
class eventyay.base.reldate.RelativeDateTimeWidget(*args, **kwargs)

Bases: MultiWidget

decompress(value)

Return a list of decompressed values for the given compressed value. The given value can be assumed to be valid, but not necessarily non-empty.

get_context(name, value, attrs)
property media

Media for a multiwidget is the combination of all media of the subwidgets.

template_name = 'pretixbase/forms/widgets/reldatetime.html'
class eventyay.base.reldate.RelativeDateWidget(*args, **kwargs)

Bases: RelativeDateTimeWidget

decompress(value)

Return a list of decompressed values for the given compressed value. The given value can be assumed to be valid, but not necessarily non-empty.

property media

Media for a multiwidget is the combination of all media of the subwidgets.

template_name = 'pretixbase/forms/widgets/reldate.html'
class eventyay.base.reldate.RelativeDateWrapper(data: datetime | RelativeDate)

Bases: object

This contains information on a date that might be relative to an event. This means that the underlying data is either a fixed date or a number of days and a wall clock time to calculate the date based on a base point.

The base point can be the date_from, date_to, date_admission, presale_start or presale_end attribute of an event or subevent. If the respective attribute is not set, date_from will be used.

date(event) date
datetime(event) datetime
classmethod from_string(input: str)
to_string() str
class eventyay.base.reldate.SerializerRelativeDateField(*args, **kwargs)

Bases: CharField

to_internal_value(data)

Transform the incoming primitive data into a native value.

to_representation(value: RelativeDateWrapper)

Transform the outgoing native value into primitive data.

class eventyay.base.reldate.SerializerRelativeDateTimeField(*args, **kwargs)

Bases: CharField

to_internal_value(data)

Transform the incoming primitive data into a native value.

to_representation(value: RelativeDateWrapper)

Transform the outgoing native value into primitive data.

eventyay.helpers.daterange.daterange(df, dt)

Validation

class eventyay.base.validators.BanlistValidator

Bases: object

banlist = []
class eventyay.base.validators.EmailBanlistValidator(*args, **kwargs)

Bases: BanlistValidator

banlist = ['info@eventyay.com']
deconstruct()

Return a 3-tuple of class import path, positional arguments, and keyword arguments.

class eventyay.base.validators.EventSlugBanlistValidator(*args, **kwargs)

Bases: BanlistValidator

banlist = ['download', 'healthcheck', 'locale', 'control', 'redirect', 'jsi18n', 'metrics', '_global', '__debug__', 'api', 'events', 'csp_report', 'widget']
deconstruct()

Return a 3-tuple of class import path, positional arguments, and keyword arguments.

class eventyay.base.validators.OrganizerSlugBanlistValidator(*args, **kwargs)

Bases: BanlistValidator

banlist = ['download', 'healthcheck', 'locale', 'control', 'pretixdroid', 'redirect', 'jsi18n', 'metrics', '_global', '__debug__', 'about', 'api', 'csp_report', 'widget']
deconstruct()

Return a 3-tuple of class import path, positional arguments, and keyword arguments.

Cache

class eventyay.base.cache.NamespacedCache(prefixkey: str, cache: str = 'default')

Bases: object

clear() None
close()
decr(key: str, by: int = 1)
delete(key: str)
delete_many(keys: List[str])
get(key: str) str
get_many(keys: List[str]) Dict[str, str]
get_or_set(key: str, default: Callable, timeout=300) str
incr(key: str, by: int = 1)
set(key: str, value: str, timeout: int = 300)
set_many(values: Dict[str, str], timeout=300)
class eventyay.base.cache.ObjectRelatedCache(obj: Model, cache: str = 'default')

Bases: NamespacedCache

This object behaves exactly like the cache implementations by Django but with one important difference: It stores all keys related to a certain object, so you pass an object when creating this object and if you store data in this cache, it is only stored for this object. The main purpose of this is to be able to flush all cached data related to this object at once.

The ObjectRelatedCache instance itself is stateless, all state is stored in the cache backend, so you can instantiate this class as many times as you want.

class eventyay.helpers.cache.CustomDummyCache(host, *args, **kwargs)

Bases: DummyCache

get_or_set(key, default, timeout=<object object>, version=None)

Fetch a given key from the cache. If the key does not exist, add the key and set it to the default value. The default value can also be any callable. If timeout is given, use that timeout for the key; otherwise use the default cache timeout.

Return the value of the key stored or retrieved.

Storage

class eventyay.base.storage.NoMapManifestStaticFilesStorage(*args, **kwargs)

Bases: ManifestStaticFilesStorage

post_process(paths, dry_run=False, **options)

Post process the given dictionary of files (called from collectstatic).

Processing is actually two separate operations:

  1. renaming files to include a hash of their content for cache-busting, and copying those files to the target storage.

  2. adjusting files which contain references to other files so they refer to the cache-busting filenames.

If either of these are performed on a file, then that file is considered post-processed.

class eventyay.storage.StorageConfig(app_name, app_module)

Bases: AppConfig

label = 'storage'
name = 'eventyay.storage'

Context Processors

eventyay.base.context.contextprocessor(request)
eventyay.control.context.contextprocessor(request)

Adds data to all template contexts

eventyay.common.context_processors.add_events(request: HttpRequest)
eventyay.common.context_processors.locale_context(request)
eventyay.common.context_processors.messages(request)
eventyay.common.context_processors.system_information(request)

Metrics & Monitoring

class eventyay.base.metrics.Counter(name, helpstring, labelnames=None)

Bases: Metric

Counter Metric Object Counters can only be increased, they can neither be set to a specific value nor decreased.

inc(amount=1, **kwargs)

Increments Counter by given amount for the labels specified in kwargs.

class eventyay.base.metrics.Gauge(name, helpstring, labelnames=None)

Bases: Metric

Gauge Metric Object Gauges can be set to a specific value, increased and decreased.

dec(amount=1, **kwargs)

Decrements Gauge by given amount for the labels specified in kwargs.

inc(amount=1, **kwargs)

Increments Gauge by given amount for the labels specified in kwargs.

set(value=1, **kwargs)

Sets Gauge to a specific value for the labels specified in kwargs.

class eventyay.base.metrics.Histogram(name, helpstring, labelnames=None, buckets=(0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0, 30.0, inf))

Bases: Metric

Histogram Metric Object

observe(amount, **kwargs)

Stores a value in the histogram for the labels specified in kwargs.

class eventyay.base.metrics.Metric(name, helpstring, labelnames=None)

Bases: object

Base Metrics Object

eventyay.base.metrics.estimate_count_fast(type)

See https://wiki.postgresql.org/wiki/Count_estimate

eventyay.base.metrics.metric_values()

Produces the the values to be presented to the monitoring system

Timeline & Activity

class eventyay.base.timeline.TimelineEvent(event, subevent, datetime, description, edit_url)

Bases: tuple

datetime

Alias for field number 2

description

Alias for field number 3

edit_url

Alias for field number 4

event

Alias for field number 0

subevent

Alias for field number 1

eventyay.base.timeline.timeline_for_event(event, subevent=None)