Registration

Todo

Docstrings (module, models, utilities, statistics)

Models

class indico.modules.events.registration.models.registrations.PublishRegistrationsMode(value)

An enumeration.

hide_all = 0
show_all = 2
class indico.modules.events.registration.models.registrations.Registration(**kwargs)

Somebody’s registration for an event through a registration form.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

property avatar_url

Return the url of the user’s avatar.

base_price

The base registration fee (that is not specific to form items)

property billable_data
property can_be_modified
property can_be_withdrawn
checked_in

Whether the person has checked in. Setting this also sets or clears checked_in_dt.

checked_in_dt

The date/time when the person has checked in

consent_to_publish

Type of consent given to publish this registration

created_by_manager

Whether the registration was created by a manager

currency

Registration price currency

data

The registration this data is associated with

property data_by_field
property display_full_name

Return the full name using the user’s preferred name format.

email

The email of the registrant

event

The Event containing this registration

event_id

The ID of the event

first_name

The first name of the registrant

friendly_id

The human-friendly ID for the object

property full_name

Return the user’s name in ‘Firstname Lastname’ notation.

classmethod get_all_for_event(event)

Retrieve all registrations in all registration forms of an event.

get_full_name(last_name_first=True, last_name_upper=False, abbrev_first_name=False)

Return the user’s in the specified notation.

If not format options are specified, the name is returned in the ‘Lastname, Firstname’ notation.

Note: Do not use positional arguments when calling this method. Always use keyword arguments!

Parameters
  • last_name_first – if “lastname, firstname” instead of “firstname lastname” should be used

  • last_name_upper – if the last name should be all-uppercase

  • abbrev_first_name – if the first name should be abbreviated to use only the first character

get_personal_data()
has_conflict()

Check if there are other valid registrations for the same user.

This is intended for cases where this registration is currenly invalid (rejected or withdrawn) to determine whether it would be acceptable to restore it.

property has_files
id

The ID of the object

is_active
is_cancelled
is_deleted

If the registration has been deleted

property is_paid

Return whether the registration has been paid for.

is_pending_transaction_expired()

Check if the registration has a pending transaction that expired.

is_publishable(is_participant)
is_state_publishable
property is_ticket_blocked

Check whether the ticket is blocked by a plugin.

last_name

The last name of the registrant

locator()

Define a smart locator property.

This behaves pretty much like a normal read-only property and the decorated function should return a dict containing the necessary data to build a URL for the object.

This decorator should usually be applied to a method named locator as this name is required for get_locator to find it automatically when just passing the object.

If you need more than one locator, you can define it like this:

@locator_property
def locator(self):
    return {...}

@locator.other
def locator(self):
    return {...}

The other locator can then be accessed by passing obj.locator.other to the code expecting an object with a locator.

log(*args, **kwargs)

Log with prefilled metadata for the registration.

classmethod merge_users(target, source)
order_by_name = (<sqlalchemy.sql.functions.Function at 0x7f2714880fa0; lower>, <sqlalchemy.sql.functions.Function at 0x7f2714880a90; lower>, <sqlalchemy.orm.attributes.InstrumentedAttribute object>)
participant_hidden

Management-set override for visibility

property payment_dt

The date/time when the registration has been paid for.

property price

The total price of the registration.

This includes the base price, the field-specific price, and the custom price adjustment for the registrant.

Return type

Decimal

price_adjustment

The price modifier applied to the final calculated price

query: IndicoBaseQuery
registration_form_id

The ID of the registration form

rejection_reason

If given a reason for rejection

render_base_price()
render_price()
render_price_adjustment()
property sections_with_answered_fields
state

The state a registration is in

submitted_dt

The date/time when the registration was recorded

property summary_data

Export registration data nested in sections and fields.

sync_state(_skip_moderation=True)

Sync the state of the registration.

tags

The registration tags assigned to this registration

ticket_uuid

The unique token used in tickets

transaction

The latest payment transaction associated with this registration

transaction_id

The ID of the latest payment transaction associated with this registration

update_state(approved=None, paid=None, rejected=None, withdrawn=None, _skip_moderation=False)

Update the state of the registration for a given action.

The accepted kwargs are the possible actions. True means that the action occured and False that it was reverted.

user
user_id

The ID of the user who registered

uuid

The unguessable ID for the object

property visibility
property visibility_before_override
class indico.modules.events.registration.models.registrations.RegistrationData(**kwargs)

Data entry within a registration for a field in a registration form.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

add_file_date_column = False

Whether to track the creation time. This is required when using versioning!

content_type

The MIME type of the file.

created_dt = None
data

The submitted data for the field

extension

The extension of the file.

field_data

The associated field data object

field_data_id

The ID of the field data

property file
file_required = False

Whether a row must always contain a file

filename

The name of the file.

property friendly_data
get_friendly_data(**kwargs)
locator()

Define a smart locator property.

This behaves pretty much like a normal read-only property and the decorated function should return a dict containing the necessary data to build a URL for the object.

This decorator should usually be applied to a method named locator as this name is required for get_locator to find it automatically when just passing the object.

If you need more than one locator, you can define it like this:

@locator_property
def locator(self):
    return {...}

@locator.other
def locator(self):
    return {...}

The other locator can then be accessed by passing obj.locator.other to the code expecting an object with a locator.

md5

An MD5 hash of the file.

Automatically assigned when save() is called.

property price
query: IndicoBaseQuery
registration_id

The ID of the registration

render_price()
property search_data
size

The size of the file (in bytes).

Automatically assigned when save() is called.

storage_backend
storage_file_id
property summary_data
property user_data
class indico.modules.events.registration.models.registrations.RegistrationState(value)

An enumeration.

complete = 1
pending = 2
rejected = 3
unpaid = 5
withdrawn = 4
class indico.modules.events.registration.models.registrations.RegistrationVisibility(value)

An enumeration.

all = 2
nobody = 0
participants = 1
class indico.modules.events.registration.models.form_fields.RegistrationFormField(**kwargs)

A registration form field.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

calculate_price(registration_data)
children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

property field_impl

Gets the implementation of the field.

Returns

An instance of a RegistrationFormFieldBase subclass

get_friendly_data(registration_data, **kwargs)
property html_field_name
id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

property locator
parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery
registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property versioned_data
property view_data

Return object with data that Angular can understand.

class indico.modules.events.registration.models.form_fields.RegistrationFormFieldData(**kwargs)

Description of a registration form field.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

field_id

The ID of the registration form field

id

The ID of the object

query: IndicoBaseQuery
versioned_data

Data describing the field

class indico.modules.events.registration.models.form_fields.RegistrationFormPersonalDataField(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

property html_field_name
id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery
registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property view_data

Return object with data that Angular can understand.

class indico.modules.events.registration.models.forms.ModificationMode(value)

An enumeration.

allowed_always = 1
allowed_until_approved = 4
allowed_until_payment = 2
not_allowed = 3
class indico.modules.events.registration.models.forms.RegistrationForm(**kwargs)

A registration form for an event.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

property active_fields
property active_labels
property active_registrations
property active_sections
attach_ical

If the completed registration email should include the event’s iCalendar file.

base_price

The base fee users have to pay when registering

can_submit(user)
contact_info

Contact information for registrants

currency

Currency for prices in the registration form

property disabled_sections
end_dt

Datetime when the registration form is closed

event

The Event containing this registration form

event_id

The ID of the event

form_items
get_personal_data_field_id(personal_data_type)

Return the field id corresponding to the personal data field with the given name.

get_registration(user=None, uuid=None, email=None)

Retrieve registrations for this registration form by user or uuid.

has_ended
has_started
id

The ID of the object

property identifier
introduction
invitations

The registration invitations associated with this form

property is_active
is_deleted

Whether the registration has been marked as deleted

is_modification_allowed(registration)

Check whether a registration may be modified.

is_modification_open
is_open
is_participant_list_visible(is_participant)
is_participation

Whether it’s the ‘Participants’ form of a meeting/lecture

is_purged

Whether the registrations have been deleted due to an expired retention period

is_scheduled
property limit_reached
property locator
manager_notification_recipients

List of emails that should receive management notifications

manager_notifications_enabled

Whether the manager notifications for this event are enabled

message_complete

Custom message to include in emails for complete registrations

message_pending

Custom message to include in emails for pending registrations

message_unpaid

Custom message to include in emails for unpaid registrations

moderation_enabled

Whether registrations must be approved by a manager

modification_end_dt

Datetime when the modification period is over

modification_mode

Whether registration modifications are allowed

property name
notification_sender_address

Notifications sender address

principal_order = 2
principal_type = 8
publish_checkin_enabled

Whether checked-in status should be displayed in the event pages and participant list

publish_registration_count

Whether to display the number of registrations

publish_registrations_duration

For how long should the registrations be displayed after the event ends

publish_registrations_participants

Which registrations should be displayed in the private participant list

publish_registrations_public

Which registrations should be displayed in the public participant list

query: IndicoBaseQuery
registration_limit

Maximum number of registrations allowed

registrations

The registrations associated with this form

render_base_price()
require_captcha

Whether to show captcha for users without an account

require_login

Whether users must be logged in to register

require_user

Whether registrations must be associated with an Indico account

retention_period

period for which the registration itself should be kept

property sections
start_dt

Datetime when the registration form is open

ticket_on_email

Whether to send tickets by e-mail

ticket_on_event_page

Whether to show a ticket download link on the event homepage

ticket_on_summary_page

Whether to show a ticket download link on the registration summary page

ticket_template

The template used to generate tickets

ticket_template_id

The ID of the template used to generate tickets

tickets_enabled

Whether tickets are enabled for this form

title

The title of the registration form

class indico.modules.events.registration.models.invitations.InvitationState(value)

An enumeration.

accepted = 1
declined = 2
pending = 0
class indico.modules.events.registration.models.invitations.RegistrationInvitation(**kwargs)

An invitation for someone to register.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

affiliation

The affiliation of the invited person

email

The email of the invited person

first_name

The first name of the invited person

id

The ID of the invitation

last_name

The last name of the invited person

locator()

Define a smart locator property.

This behaves pretty much like a normal read-only property and the decorated function should return a dict containing the necessary data to build a URL for the object.

This decorator should usually be applied to a method named locator as this name is required for get_locator to find it automatically when just passing the object.

If you need more than one locator, you can define it like this:

@locator_property
def locator(self):
    return {...}

@locator.other
def locator(self):
    return {...}

The other locator can then be accessed by passing obj.locator.other to the code expecting an object with a locator.

query: IndicoBaseQuery
registration

The associated registration

registration_form_id

The ID of the registration form

registration_id

The ID of the registration (if accepted)

skip_moderation

Whether registration moderation should be skipped

state

The state of the invitation

uuid

The UUID of the invitation

class indico.modules.events.registration.models.items.PersonalDataType(value)

Description of the personal data items that exist on every registration form.

FIELD_DATA = [(<PersonalDataType.first_name: 2>, {'title': 'First Name', 'input_type': 'text', 'position': 1}), (<PersonalDataType.last_name: 3>, {'title': 'Last Name', 'input_type': 'text', 'position': 2}), (<PersonalDataType.email: 1>, {'title': 'Email Address', 'input_type': 'email', 'position': 3}), (<PersonalDataType.affiliation: 4>, {'title': 'Affiliation', 'input_type': 'text', 'position': 4}), (<PersonalDataType.address: 6>, {'title': 'Address', 'input_type': 'textarea', 'is_enabled': False, 'position': 1000}), (<PersonalDataType.country: 8>, {'title': 'Country', 'input_type': 'country', 'is_enabled': False, 'position': 1001}), (<PersonalDataType.phone: 7>, {'title': 'Phone Number', 'input_type': 'phone', 'is_enabled': False, 'position': 1002}), (<PersonalDataType.position: 9>, {'title': 'Position', 'input_type': 'text', 'is_enabled': False, 'position': 1003}), (<PersonalDataType.title: 5>, {'title': 'Title', 'input_type': 'single_choice', 'is_enabled': False, 'position': 1004, 'data': {'item_type': 'dropdown', 'with_extra_slots': False, 'choices': [{'price': 0, 'places_limit': 0, 'is_enabled': True, 'id': 'a8b742ef-eaf8-48b4-93bb-1c199d6c2ce2', 'caption': 'Mr'}, {'price': 0, 'places_limit': 0, 'is_enabled': True, 'id': '1c0f1cc8-8f4a-4369-b88d-f4a57038ab7b', 'caption': 'Ms'}, {'price': 0, 'places_limit': 0, 'is_enabled': True, 'id': '149d7713-73c2-4add-a8b8-e09a94b4f118', 'caption': 'Mrs'}, {'price': 0, 'places_limit': 0, 'is_enabled': True, 'id': '0e47655f-2c56-44dc-9f42-079520a072e8', 'caption': 'Dr'}, {'price': 0, 'places_limit': 0, 'is_enabled': True, 'id': 'f2303fe4-d6b4-4940-a6ea-9f7a6cdf5a22', 'caption': 'Prof.'}, {'price': 0, 'places_limit': 0, 'is_enabled': True, 'id': 'e38dd84a-9279-40f9-a72e-f855fbf38e30', 'caption': 'Mx'}]}})]
address = 6
affiliation = 4
property column

The Registration column in which the value is stored in addition to the regular registration data entry.

country = 8
email = 1
first_name = 2
get_title()
property is_required
last_name = 3
phone = 7
position = 9
title = 5
class indico.modules.events.registration.models.items.RegistrationFormItem(**kwargs)

Generic registration form item.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

id

The ID of the object

input_type

input type of this field

property is_active
is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_field
is_label
is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

is_section
is_visible
log(*args, **kwargs)

Log with prefilled metadata for the item.

parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery
registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property view_data

Return object with data that Angular can understand.

class indico.modules.events.registration.models.items.RegistrationFormItemType(value)

An enumeration.

field = 2
field_pd = 5
section = 1
section_pd = 4
text = 3
class indico.modules.events.registration.models.items.RegistrationFormPersonalDataSection(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

property own_data
parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery
registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

class indico.modules.events.registration.models.items.RegistrationFormSection(**kwargs)

Registration form section that can contain fields and text.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

property active_fields
children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

property fields
id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

property locator
property own_data
parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery
registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property view_data

Return object with data that Angular can understand.

class indico.modules.events.registration.models.items.RegistrationFormText(**kwargs)

Text to be displayed in registration form sections.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

property locator
parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery
registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property view_data

Return object with data that Angular can understand.

Utilities

class indico.modules.events.registration.util.RegistrationSchemaBase(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)
class Meta
unknown = 'raise'
opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
indico.modules.events.registration.util.build_registration_api_data(registration)
indico.modules.events.registration.util.build_registrations_api_data(event)
indico.modules.events.registration.util.check_registration_email(regform, email, registration=None, management=False)

Check whether an email address is suitable for registration.

Parameters
  • regform – The registration form

  • email – The email address

  • registration – The existing registration (in case of modification)

  • management – If it’s a manager adding a new registration

indico.modules.events.registration.util.close_registration(regform)
indico.modules.events.registration.util.count_hidden_registrations(event, is_participant)

Get the number of hidden registrations for an event.

Parameters
  • event – the Event to get registrations for

  • is_participant – whether the user accessing the registrations is a participant of the event

Returns

number of registrations

indico.modules.events.registration.util.create_invitation(regform, user, skip_moderation, email_from, email_subject, email_body)
indico.modules.events.registration.util.create_personal_data_fields(regform)

Create the special section/fields for personal data.

indico.modules.events.registration.util.create_registration(regform, data, invitation=None, management=False, notify_user=True, skip_moderation=None)
indico.modules.events.registration.util.diff_registration_data(old_data, new_data)

Compare two sets of registration data.

Returns

A dictionary where the key is the html name of the field and the value is the old and new friendly data and the field price

indico.modules.events.registration.util.generate_spreadsheet_from_registrations(registrations, regform_items, static_items)

Generate a spreadsheet data from a given registration list.

Parameters
  • registrations – The list of registrations to include in the file

  • regform_items – The registration form items to be used as columns

  • static_items – Registration form information as extra columns

indico.modules.events.registration.util.generate_ticket(registration)
indico.modules.events.registration.util.generate_ticket_qr_code(registration)

Generate a Pillow Image with a QR Code encoding a check-in ticket.

Parameters

registration – corresponding Registration object

indico.modules.events.registration.util.get_country_field(regform)

Get the country personal-data field of a regform

indico.modules.events.registration.util.get_event_regforms(event, user, with_registrations=False, only_in_acl=False)

Get registration forms with information about user registrations.

Parameters
  • event – the Event to get registration forms for

  • user – A User

  • with_registrations – Whether to return the user’s registration instead of just whether they have one

  • only_in_acl – Whether to include only registration forms that are in the event’s ACL

indico.modules.events.registration.util.get_event_regforms_registrations(event, user, include_scheduled=True, only_in_acl=False)

Get regforms and the associated registrations for an event+user.

Parameters
  • event – the Event to get registration forms for

  • user – A User

  • include_scheduled – Whether to include scheduled but not open registration forms

  • only_in_acl – Whether to include only registration forms that are in the event’s ACL

Returns

A tuple, which includes: - All registration forms which are scheduled, open or registered. - A dict mapping all registration forms to the user’s registration if they have one.

indico.modules.events.registration.util.get_events_registered(user, dt=None)

Get the IDs of events where the user is registered.

Parameters
  • user – A User

  • dt – Only include events taking place on/after that date

Returns

A set of event ids

indico.modules.events.registration.util.get_flat_section_positions_setup_data(regform)
indico.modules.events.registration.util.get_flat_section_setup_data(regform)
indico.modules.events.registration.util.get_flat_section_submission_data(regform, *, management=False, registration=None)
indico.modules.events.registration.util.get_form_registration_data(regform, registration, *, management=False)

Return a mapping from ‘html_field_name’ to the registration data. This also includes default values for any newly added fields since the React frontend requires all initial values to be present.

indico.modules.events.registration.util.get_initial_form_values(regform, *, management=False)
indico.modules.events.registration.util.get_published_registrations(event, is_participant)

Get a list of published registrations for an event.

Parameters
  • event – the Event to get registrations for

  • is_participant – whether the user accessing the registrations is a participant of the event

Returns

list of Registration objects

indico.modules.events.registration.util.get_registered_event_persons(event)

Get all registered EventPersons of an event.

indico.modules.events.registration.util.get_registrations_with_tickets(user, event)
indico.modules.events.registration.util.get_ticket_attachments(registration)
indico.modules.events.registration.util.get_title_uuid(regform, title)

Convert a string title to its UUID value.

If the title does not exist in the title PD field, it will be ignored and returned as None.

indico.modules.events.registration.util.get_user_data(regform, user, invitation=None)
indico.modules.events.registration.util.import_invitations_from_csv(regform, fileobj, email_from, email_subject, email_body, skip_moderation=True, skip_existing=False)

Import invitations from a CSV file.

Returns

A list of invitations and the number of skipped records which is zero if skip_existing=False

indico.modules.events.registration.util.import_registrations_from_csv(regform, fileobj, skip_moderation=True, notify_users=False)

Import event registrants from a CSV file into a form.

indico.modules.events.registration.util.import_user_records_from_csv(fileobj, columns)

Parse and do basic validation of user data from a CSV file.

Parameters
  • fileobj – the CSV file to be read

  • columns – A list of column names, ‘first_name’, ‘last_name’, & ‘email’ are compulsory.

Returns

A list dictionaries each representing one row, the keys of which are given by the column names.

indico.modules.events.registration.util.make_registration_schema(regform, management=False, registration=None, captcha_required=False)

Dynamically create a Marshmallow schema based on the registration form fields.

indico.modules.events.registration.util.modify_registration(registration, data, management=False, notify_user=True)
indico.modules.events.registration.util.serialize_registration_form(regform)

Serialize registration form to JSON-like object.

indico.modules.events.registration.util.snapshot_registration_data(registration)
indico.modules.events.registration.util.update_regform_item_positions(regform)

Update positions when deleting/disabling an item in order to prevent gaps.

Placeholders

class indico.modules.events.registration.placeholders.registrations.EventLinkPlaceholder
description = l'Link to the event'

A short description of the placeholder.

name = 'event_link'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.EventTitlePlaceholder
description = l'The title of the event'

A short description of the placeholder.

name = 'event_title'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.FieldPlaceholder
advanced = True

Whether the placeholder should not be shown by default

description = None

A short description of the placeholder.

classmethod iter_param_info(regform, registration)

Yield information for known params.

Each item yielded must be a (value, description) tuple.

Parameters

kwargs – arguments specific to the placeholder’s context

name = 'field'

The name of the placeholder. Must be unique within the context where the placeholder is used

param_required = True

Whether the param is required

param_restricted = True

Whether only params defined in iter_param_info are allowed

classmethod render(param, regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.FirstNamePlaceholder
description = l'First name of the person'

A short description of the placeholder.

name = 'first_name'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.IDPlaceholder
description = l'The ID of the registration'

A short description of the placeholder.

name = 'id'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.LastNamePlaceholder
description = l'Last name of the person'

A short description of the placeholder.

name = 'last_name'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.LinkPlaceholder
description = l'The link to the registration details'

A short description of the placeholder.

name = 'link'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.RejectionReasonPlaceholder
description = l'The reason why the registration was rejected'

A short description of the placeholder.

name = 'rejection_reason'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.invitations.FirstNamePlaceholder
description = l'First name of the person'

A short description of the placeholder.

name = 'first_name'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(invitation)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.invitations.InvitationLinkPlaceholder
description = l'Link to accept/decline the invitation'

A short description of the placeholder.

name = 'invitation_link'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(invitation)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

required = True

Whether the placeholder must be used at least once.

class indico.modules.events.registration.placeholders.invitations.LastNamePlaceholder
description = l'Last name of the person'

A short description of the placeholder.

name = 'last_name'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(invitation)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters

kwargs – arguments specific to the placeholder’s context

Settings

class indico.modules.events.registration.settings.RegistrationSettingsProxy(module, defaults=None, strict=True, acls=None, converters=None)

Store per-event registration settings.

get_participant_list_columns(event, form=None)
get_participant_list_form_ids(event)
set_participant_list_columns(event, columns, form=None)
set_participant_list_form_ids(event, form_ids)

Statistics

class indico.modules.events.registration.stats.AccommodationStats(field)

Base class for registration form statistics.

Parameters
  • title – str – the title for the stats box

  • subtitle – str – the subtitle for the stats box

  • type – str – the type used in Jinja to display the stats

class indico.modules.events.registration.stats.Cell(type='default', data=None, colspan=1, classes=None, qtip=None)

Hold data and type for a cell of a stats table.

The table below indicates the valid types and expected data.

type

data

str

str – string value

progress

(int, str) – a tuple with the progress (a value between 0 and 1) and a label

progress-stacked

([int], str) – a tuple with a list of progresses (values which must sum up to 1) and a label

currency

float – numeric value

icon

str – icon name from _icons.scss

default

None – renders a default cell with an &mdash; (use Cell(type=’str’) for an empty cell)

Parameters
  • type – str – The type of data in the cell

  • data – The data for the cell

  • colspan – int – HTML colspan value for the cell

  • classes – [str] – HTML classes to apply to the cell

  • qtip – str – content for qtip

class indico.modules.events.registration.stats.DataItem(regs=0, attendance=0, capacity=0, billable=False, cancelled=False, price=0, fixed_price=False, paid=0, paid_amount=0, unpaid=0, unpaid_amount=0)

Hold the aggregation of some data, intended for stats tables as a aggregation from which to generate cells.

Parameters
  • regs – int – number of registrant

  • attendance – int – number of people attending

  • capacity – int – maximum number of people allowed to attend (0 if unlimited)

  • billable – bool – whether the item is billable to the or not

  • cancelled – bool – whether the item is cancelled or not

  • price – str – the price of the item

  • fixed_price – bool – True if the price is per registrant, False if accompanying guests must pay as well.

  • paid – int – number of registrants who paid

  • paid_amount – float – amount already paid by registrants

  • unpaid – int – number of registrants who haven’t paid

  • unpaid_amount – float – amount not already paid by registrants

class indico.modules.events.registration.stats.FieldStats(field, **kwargs)

Hold stats for a registration form field.

get_table()

Return a table containing the stats for each item.

Returns

dict – A table with a list of head cells (key: ‘head’) and a list of rows (key: ‘rows’) where each row is a list of cells.

property is_currency_shown
class indico.modules.events.registration.stats.OverviewStats(regform)

Generic stats for a registration form.

Base class for registration form statistics.

Parameters
  • title – str – the title for the stats box

  • subtitle – str – the subtitle for the stats box

  • type – str – the type used in Jinja to display the stats

class indico.modules.events.registration.stats.StatsBase(title, subtitle, type, **kwargs)

Base class for registration form statistics.

Parameters
  • title – str – the title for the stats box

  • subtitle – str – the subtitle for the stats box

  • type – str – the type used in Jinja to display the stats

property is_currency_shown