Registration¶
Todo
Docstrings (module, models, utilities, statistics)
Models¶
-
class
indico.modules.events.registration.models.registrations.
Registration
(**kwargs)¶ Bases:
sqlalchemy.orm.decl_api.Model
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.
-
avatar_url
¶ Return the url of the user’s avatar.
-
base_price
¶ The base registration fee (that is not specific to form items)
-
billable_data
¶
-
can_be_modified
¶
-
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
-
currency
¶ Registration price currency
-
data
¶ The registration this data is associated with
-
data_by_field
¶
-
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
-
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.
-
has_files
¶
-
id
¶ The ID of the object
-
is_active
¶
-
is_cancelled
¶
-
is_deleted
¶ If the registration has been deleted
-
is_paid
¶ Return whether the registration has been paid for.
-
is_publishable
¶
-
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 passingobj.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 0x7f9b8c079ee0; lower>, <sqlalchemy.sql.functions.Function at 0x7f9b8c079610; lower>, <sqlalchemy.orm.attributes.InstrumentedAttribute object>)¶
-
payment_dt
¶ The date/time when the registration has been paid for.
-
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
-
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
()¶
-
sections_with_answered_fields
¶
-
state
¶ The state a registration is in
-
submitted_dt
¶ The date/time when the registration was recorded
-
summary_data
¶ Export registration data nested in sections and fields.
-
sync_state
(_skip_moderation=True)¶ Sync the state of the 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 andFalse
that it was reverted.
-
user
¶
-
user_id
¶ The ID of the user who registered
-
uuid
¶ The unguessable ID for the object
-
-
class
indico.modules.events.registration.models.registrations.
RegistrationData
(**kwargs)¶ Bases:
indico.core.storage.models.StoredFileMixin
,sqlalchemy.orm.decl_api.Model
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¶
-
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
-
file
¶
-
file_required
= False¶
-
filename
¶ The name of the file.
-
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 passingobj.locator.other
to the code expecting an object with a locator.
-
md5
¶ An MD5 hash of the file.
Automatically assigned when save() is called.
-
price
¶
-
registration_id
¶ The ID of the registration
-
render_price
()¶
-
search_data
¶
-
size
¶ The size of the file (in bytes).
Automatically assigned when save() is called.
-
storage_backend
¶
-
storage_file_id
¶
-
summary_data
¶
-
user_data
¶
-
-
class
indico.modules.events.registration.models.registrations.
RegistrationState
¶ Bases:
indico.util.enum.RichIntEnum
An enumeration.
-
complete
= 1¶
-
pending
= 2¶
-
rejected
= 3¶
-
unpaid
= 5¶
-
withdrawn
= 4¶
-
-
class
indico.modules.events.registration.models.form_fields.
RegistrationFormField
(**kwargs)¶ Bases:
indico.modules.events.registration.models.items.RegistrationFormItem
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
¶
-
current_data_id
¶
-
data
¶
-
data_versions
¶
-
description
¶
-
field_impl
¶ Gets the implementation of the field.
Returns: An instance of a RegistrationFormFieldBase subclass
-
get_friendly_data
(registration_data, **kwargs)¶
-
html_field_name
¶
-
id
¶
-
input_type
¶
-
is_deleted
¶
-
is_enabled
¶
-
is_manager_only
¶
-
is_required
¶
-
locator
¶
-
parent_id
¶
-
personal_data_type
¶
-
position
¶
-
registration_form_id
¶
-
title
¶
-
type
¶
-
versioned_data
¶
-
view_data
¶ Return object with data that Angular can understand.
-
-
class
indico.modules.events.registration.models.form_fields.
RegistrationFormFieldData
(**kwargs)¶ Bases:
sqlalchemy.orm.decl_api.Model
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
-
versioned_data
¶ Data describing the field
-
-
class
indico.modules.events.registration.models.form_fields.
RegistrationFormPersonalDataField
(**kwargs)¶ Bases:
indico.modules.events.registration.models.form_fields.RegistrationFormField
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
¶
-
current_data_id
¶
-
data
¶
-
data_versions
¶
-
description
¶
-
html_field_name
¶
-
id
¶
-
input_type
¶
-
is_deleted
¶
-
is_enabled
¶
-
is_manager_only
¶
-
is_required
¶
-
parent_id
¶
-
personal_data_type
¶
-
position
¶
-
registration_form_id
¶
-
title
¶
-
type
¶
-
view_data
¶ Return object with data that Angular can understand.
-
-
class
indico.modules.events.registration.models.forms.
ModificationMode
¶ Bases:
indico.util.enum.RichIntEnum
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)¶ Bases:
sqlalchemy.orm.decl_api.Model
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.
-
active_fields
¶
-
active_registrations
¶
-
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
-
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
-
identifier
¶
-
introduction
¶
-
invitations
¶ The registration invitations associated with this form
-
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_participation
¶ Whether it’s the ‘Participants’ form of a meeting/lecture
-
is_scheduled
¶
-
limit_reached
¶
-
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
-
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_enabled
¶ Whether registrations should be displayed in the participant list
-
registration_limit
¶ Maximum number of registrations allowed
-
registrations
¶ The registrations associated with this form
-
render_base_price
()¶
-
require_login
¶ Whether users must be logged in to register
-
require_user
¶ Whether registrations must be associated with an Indico account
-
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
¶ Bases:
indico.util.enum.RichIntEnum
An enumeration.
-
accepted
= 1¶
-
declined
= 2¶
-
pending
= 0¶
-
-
class
indico.modules.events.registration.models.invitations.
RegistrationInvitation
(**kwargs)¶ Bases:
sqlalchemy.orm.decl_api.Model
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 passingobj.locator.other
to the code expecting an object with a locator.
-
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
¶ Bases:
int
,indico.util.enum.IndicoEnum
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, 'is_billable': False, 'places_limit': 0, 'is_enabled': True, 'id': '122eefa6-58c3-49b3-bf3d-dd305061b984', 'caption': 'Mr'}, {'price': 0, 'is_billable': False, 'places_limit': 0, 'is_enabled': True, 'id': '5cec45be-076b-4447-9659-6c695012c3c4', 'caption': 'Ms'}, {'price': 0, 'is_billable': False, 'places_limit': 0, 'is_enabled': True, 'id': 'c2cdfb7a-9e8b-4695-a323-a40b61cc4209', 'caption': 'Mrs'}, {'price': 0, 'is_billable': False, 'places_limit': 0, 'is_enabled': True, 'id': '74373b52-6409-457e-bac6-f8519b176bb0', 'caption': 'Dr'}, {'price': 0, 'is_billable': False, 'places_limit': 0, 'is_enabled': True, 'id': '3f02602e-2cb3-4626-af3e-0745308cf83e', 'caption': 'Prof.'}, {'price': 0, 'is_billable': False, 'places_limit': 0, 'is_enabled': True, 'id': 'fb5b4f86-269c-4aaf-9b60-40a8533973b8', 'caption': 'Mx'}]}})]¶
-
address
= 6¶
-
affiliation
= 4¶
-
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
()¶
-
is_required
¶
-
last_name
= 3¶
-
phone
= 7¶
-
position
= 9¶
-
title
= 5¶
-
-
class
indico.modules.events.registration.models.items.
RegistrationFormItem
(**kwargs)¶ Bases:
sqlalchemy.orm.decl_api.Model
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
-
is_deleted
¶ Whether field has been “deleted”
-
is_enabled
¶ Whether the field is enabled
-
is_field
¶
-
is_manager_only
¶ if the section is only accessible to managers
-
is_required
¶ determines if the field is mandatory
-
is_section
¶
-
is_visible
¶
-
parent_id
¶ The ID of the parent form item
-
personal_data_type
¶ The type of a personal data field
-
position
¶
-
registration_form_id
¶ The ID of the registration form
-
title
¶ The title of this field
-
type
¶ The type of the registration form item
-
view_data
¶ Return object with data that Angular can understand.
-
-
class
indico.modules.events.registration.models.items.
RegistrationFormItemType
¶ Bases:
int
,indico.util.enum.IndicoEnum
An enumeration.
-
field
= 2¶
-
field_pd
= 5¶
-
section
= 1¶
-
section_pd
= 4¶
-
text
= 3¶
-
-
class
indico.modules.events.registration.models.items.
RegistrationFormPersonalDataSection
(**kwargs)¶ Bases:
indico.modules.events.registration.models.items.RegistrationFormSection
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
¶
-
current_data_id
¶
-
data
¶
-
data_versions
¶
-
description
¶
-
id
¶
-
input_type
¶
-
is_deleted
¶
-
is_enabled
¶
-
is_manager_only
¶
-
is_required
¶
-
parent_id
¶
-
personal_data_type
¶
-
position
¶
-
registration_form_id
¶
-
title
¶
-
type
¶
-
view_data
¶ Return object with data that Angular can understand.
-
-
class
indico.modules.events.registration.models.items.
RegistrationFormSection
(**kwargs)¶ Bases:
indico.modules.events.registration.models.items.RegistrationFormItem
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.
-
active_fields
¶
-
children
¶
-
current_data
¶
-
current_data_id
¶
-
data
¶
-
data_versions
¶
-
description
¶
-
fields
¶
-
id
¶
-
input_type
¶
-
is_deleted
¶
-
is_enabled
¶
-
is_manager_only
¶
-
is_required
¶
-
locator
¶
-
own_data
¶
-
parent_id
¶
-
personal_data_type
¶
-
position
¶
-
registration_form_id
¶
-
title
¶
-
type
¶
-
view_data
¶ Return object with data that Angular can understand.
-
-
class
indico.modules.events.registration.models.items.
RegistrationFormText
(**kwargs)¶ Bases:
indico.modules.events.registration.models.items.RegistrationFormItem
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
¶
-
current_data_id
¶
-
data
¶
-
data_versions
¶
-
description
¶
-
id
¶
-
input_type
¶
-
is_deleted
¶
-
is_enabled
¶
-
is_manager_only
¶
-
is_required
¶
-
locator
¶
-
parent_id
¶
-
personal_data_type
¶
-
position
¶
-
registration_form_id
¶
-
title
¶
-
type
¶
-
view_data
¶ Return object with data that Angular can understand.
-
Utilities¶
-
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.
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.
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_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_event_section_data
(regform, management=False, registration=None)¶
-
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_published_registrations
(event)¶ Get a list of published registrations for an event.
Parameters: event – the Event to get registrations for 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.
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.
make_registration_form
(regform, management=False, registration=None)¶ Create a WTForm based on 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.
update_regform_item_positions
(regform)¶ Update positions when deleting/disabling an item in order to prevent gaps.
-
indico.modules.events.registration.util.
url_rule_to_angular
(endpoint)¶ Convert a flask-style rule to angular style.
Placeholders¶
-
class
indico.modules.events.registration.placeholders.registrations.
EventLinkPlaceholder
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'Link to the event'¶
-
name
= 'event_link'¶
-
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
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'The title of the event'¶
-
name
= 'event_title'¶
-
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
¶ Bases:
indico.util.placeholders.ParametrizedPlaceholder
-
advanced
= True¶
-
description
= None¶
-
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'¶
-
param_required
= True¶
-
param_restricted
= True¶
-
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
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'First name of the person'¶
-
name
= 'first_name'¶
-
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
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'The ID of the registration'¶
-
name
= 'id'¶
-
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
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'Last name of the person'¶
-
name
= 'last_name'¶
-
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
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'The link to the registration details'¶
-
name
= 'link'¶
-
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
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'The reason why the registration was rejected'¶
-
name
= 'rejection_reason'¶
-
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
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'First name of the person'¶
-
name
= 'first_name'¶
-
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
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'Link to accept/decline the invitation'¶
-
name
= 'invitation_link'¶
-
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¶
-
-
class
indico.modules.events.registration.placeholders.invitations.
LastNamePlaceholder
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'Last name of the person'¶
-
name
= 'last_name'¶
-
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)¶ Bases:
indico.modules.events.settings.EventSettingsProxy
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)¶ Bases:
indico.modules.events.registration.stats.FieldStats
,indico.modules.events.registration.stats.StatsBase
-
class
indico.modules.events.registration.stats.
Cell
¶ Bases:
indico.modules.events.registration.stats.Cell
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 — (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
¶ Bases:
indico.modules.events.registration.stats.DataItem
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)¶ Bases:
object
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.
-
is_currency_shown
¶
-
-
class
indico.modules.events.registration.stats.
OverviewStats
(regform)¶ Bases:
indico.modules.events.registration.stats.StatsBase
Generic stats for a registration form.
-
class
indico.modules.events.registration.stats.
StatsBase
(title, subtitle, type, **kwargs)¶ Bases:
object
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
-
is_currency_shown
¶