Event¶
Todo
Docstrings (module, models, operations, utilities, settings)
Models¶
- class indico.modules.events.models.events.Event(**kwargs)¶
An Indico event.
This model contains the most basic information related to an event.
Note that the ACL is currently only used for managers but not for view access!
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.
- ATTACHMENT_FOLDER_ID_COLUMN = 'event_id'¶
The name of the AttachmentFolder column pointing to to the object’s ID
- access_key¶
- acl_entries¶
The ACL entries for the event
- additional_info¶
- allow_access_key = True¶
Whether the object can have an access key that grants read access
- allow_location_inheritance = False¶
Whether the item can inherit its location from a parent. If this is
False
, location_parent should not be overridden.
- allow_no_access_contact = True¶
Whether the object can have contact information shown in case of no access
- allow_none_protection_parent = True¶
Whether the object can have no protection parent
- can_display(user)¶
Check whether the user can display the event in the category.
- can_lock(user)¶
Check whether the user can lock/unlock the event.
- category¶
The category containing the event
- classmethod category_chain_overlaps(category_ids)¶
Create a filter that checks whether the event has any of the provided category ids in its parent chain.
Warning: This method cannot be used in a negated filter.
- Parameters
category_ids – A list of category ids or a single category id
- category_id¶
The ID of immediate parent category of the event
- property cfa¶
- property cfp¶
- cloned_from¶
The event this one was cloned from
- cloned_from_id¶
If this event was cloned, the id of the parent event
- contact_emails¶
- contact_phones¶
- contact_title¶
- created_dt¶
The creation date of the event
- creator¶
The user who created the event
- creator_id¶
The ID of the user who created the event
- custom_boa¶
The custom book of abstracts
- custom_boa_id¶
The ID of the uploaded custom book of abstracts (if available)
- property default_language¶
- default_locale¶
- default_page¶
The event’s default page (conferences only)
- default_page_id¶
The ID of the event’s default page (conferences only)
- default_render_mode = 1¶
- delete(reason, user=None)¶
- disallowed_protection_modes = frozenset({})¶
The protection modes that are not allowed. Can be overridden in the model that is using the mixin. Affects the table structure, so any changes to it should go along with a migration step! By default, the public mode is disallowed since it does not make much sense in most cases to make something public even though its parent object is private (or inheriting).
- property display_tzinfo¶
The tzinfo of the event as preferred by the current user.
- duration¶
- property editable_types¶
- end_dt¶
The end date of the event
- property end_dt_display¶
The ‘displayed end dt’, which is usually the actual end dt, but may be overridden for a conference.
- property end_dt_local¶
- end_dt_override¶
- ends_after(dt)¶
Check whether the event ends on/after the specified date.
- enforce_locale¶
- property event¶
Convenience property so all event entities have it.
- property external_logo_url¶
- property external_url¶
- force_event_locale(user=None, *, allow_session=False)¶
- get_allowed_sender_emails(*, include_current_user=True, include_creator=True, include_managers=True, include_contact=True, include_chairs=True, include_noreply=False, extra=None)¶
Return the emails of people who can be used as senders (or rather Reply-to contacts) in emails sent from within an event.
- Parameters
include_current_user – Whether to include the email of the currently logged-in user
include_creator – Whether to include the email of the event creator
include_managers – Whether to include the email of all event managers
include_contact – Whether to include the “event contact” emails
include_chairs – Whether to include the emails of event chairpersons (or lecture speakers)
include_noreply – Whether to include the global noreply address
extra – An email address that is always included, even if it is not in any of the included lists.
- Returns
A dictionary mapping emails to pretty names
- get_contribution(id_)¶
Get a contribution of the event.
- get_contribution_field(field_id)¶
- get_forced_event_locale(user=None, *, allow_session=False)¶
- get_label_markup(size='')¶
- get_manage_button_options(*, note_may_exist=False)¶
- get_non_inheriting_objects()¶
Get a set of child objects that do not inherit protection.
- get_published_registrations(user)¶
- get_relative_event_ids()¶
Get the first, last, previous and next event IDs.
Any of those values may be
None
if there is no matching event or if it would be the current event.- Returns
A dict containing
first
,last
,prev
andnext
.
- get_session(id_=None, friendly_id=None)¶
Get a session of the event.
- get_session_block(id_, scheduled_only=False)¶
Get a session block of the event.
- get_sorted_tracks()¶
Return tracks and track groups in the correct order.
- get_verbose_title(show_speakers=False, show_series_pos=False)¶
Get the event title with some additional information.
- Parameters
show_speakers – Whether to prefix the title with the speakers of the event.
show_series_pos – Whether to suffix the title with the position and total count in the event’s series.
- happens_between(from_dt=None, to_dt=None)¶
Check whether the event takes place within two dates.
- property has_custom_boa¶
- property has_ended¶
- has_feature(feature)¶
Check if a feature is enabled for the event.
- property has_logo¶
- property has_regform_in_acl¶
- property has_stylesheet¶
- id¶
The ID of the event
- inherit_location = False¶
- inheriting_have_acl = True¶
Whether objects with inheriting protection may have their own ACL entries (which will grant access even if the user cannot access the parent object).
- is_deleted¶
If the event has been deleted
- is_locked¶
If the event is locked (read-only mode)
- is_unlisted¶
- is_user_registered(user)¶
Check whether the user is registered in the event.
This takes both unpaid and complete registrations into account.
- is_user_speaker(user)¶
- classmethod is_visible_in(category_id)¶
Create a filter that checks whether the event is visible in the specified category.
- iter_days(tzinfo=None)¶
- keywords¶
A list of tags/keywords for the event
- label¶
The label assigned to the event
- label_id¶
The ID of the label assigned to the event
- label_message¶
- location_backref_name = 'events'¶
The name of the backref added to the Room model for items which are associated with that room.
- property locator¶
- log(realm, kind, module, summary, user=None, type_='simple', data=None, meta=None)¶
Create a new log entry for the event.
- Parameters
realm – A value from
EventLogRealm
indicating the realm of the action.kind – A value from
LogKind
indicating the kind of the action that was performed.module – A human-friendly string describing the module related to the action.
summary – A one-line summary describing the logged action.
user – The user who performed the action.
type – The type of the log entry. This is used for custom rendering of the log message/data
data – JSON-serializable data specific to the log type.
meta – JSON-serializable data that won’t be displayed.
- Returns
The newly created EventLogEntry
In most cases the
simple
log type is fine. For this type, any items from data will be shown in the detailed view of the log entry. You may either use a dict (which will be sorted) alphabetically or a list ofkey, value
pairs which will be displayed in the given order.
- property logging_disabled¶
Temporarily disable event logging.
This is useful when performing actions e.g. during event creation or at other times where adding entries to the event log doesn’t make sense.
- logo¶
The logo’s raw image data
- logo_metadata¶
The metadata of the logo (hash, size, filename, content_type)
- property logo_url¶
- property map_url¶
- move(category, *, log_meta=None)¶
- move_start_dt(start_dt)¶
Set event start_dt and adjust its timetable entries.
- organizer_info¶
- own_address¶
- own_map_url¶
The url to a map for the event
- own_no_access_contact¶
- own_room¶
- own_room_id¶
- own_room_name¶
- own_venue¶
- own_venue_id¶
- own_venue_name¶
- property participation_regform¶
- pending_move_request¶
The current pending move request
- person_link_backref_name = 'event'¶
- person_link_relation_name = 'EventPersonLink'¶
- person_links¶
- possible_render_modes = {RenderMode.html}¶
- preload_all_acl_entries()¶
- protection_mode¶
- property protection_parent¶
The parent object to consult for ProtectionMode.inheriting.
- public_regform_access¶
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- references¶
External references associated with this event
- refresh_event_persons(*, notify=True)¶
Update the data for all EventPersons based on the linked Users.
- Parameters
notify – Whether to trigger the
person_updated
signal.
- render_mode = 1¶
- property reservations¶
- restore(reason=None, user=None)¶
- property scheduled_notes¶
- series¶
The series this event is part of
- series_id¶
The ID of the series this events belongs to
- property session_block_count¶
- settings¶
- property short_external_url¶
- property short_url¶
- start_dt¶
The start date of the event
- property start_dt_display¶
The ‘displayed start dt’, which is usually the actual start dt, but may be overridden for a conference.
- property start_dt_local¶
- start_dt_override¶
- starts_between(from_dt=None, to_dt=None)¶
Check whether the event starts within two dates.
- stylesheet¶
The stylesheet’s raw image data
- stylesheet_metadata¶
The metadata of the stylesheet (hash, size, filename)
- property supported_languages¶
- supported_locales¶
- property theme¶
- timezone¶
The timezone of the event
- title¶
- property type¶
- type_¶
- property tzinfo¶
- property url¶
- url_shortcut¶
The URL shortcut for the event
- visibility¶
The visibility depth in category overviews
- class indico.modules.events.models.events.EventType(value)¶
An enumeration.
- conference = 3¶
- lecture = 1¶
- property legacy_name¶
- meeting = 2¶
- class indico.modules.events.models.persons.AuthorsSpeakersMixin¶
- AUTHORS_SPEAKERS_DISPLAY_ORDER_ATTR = 'display_order_key'¶
- property primary_authors¶
- property secondary_authors¶
- property speakers¶
- class indico.modules.events.models.persons.EventPerson(**kwargs)¶
A person inside an event, e.g. a speaker/author etc.
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.
- address¶
- affiliation¶
- affiliation_id¶
the id of the underlying predefined affiliation
- affiliation_link¶
- classmethod create_from_user(user, event=None, is_untrusted=False)¶
- email¶
- event¶
- event_id¶
- first_name¶
- classmethod for_user(user, event=None, is_untrusted=False)¶
Return EventPerson for a matching User in Event creating if needed.
- get_unsynced_data()¶
Return data no longer in sync with the user.
- property has_links¶
Whether the person is an author, speaker, etc., in the event.
- has_role(role, obj)¶
Whether the person has a role in the ACL list of a given object.
- id¶
- property identifier¶
- invited_dt¶
- is_untrusted¶
- last_name¶
- classmethod link_user_by_email(user)¶
Link all email-based persons matching the user’s email addresses with the user.
- Parameters
user – A User object.
- 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.
- merge_person_info(other)¶
- classmethod merge_users(target, source)¶
Merge the EventPersons of two users.
- Parameters
target – The target user of the merge
source – The user that is being merged into target
- phone¶
- property principal¶
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- sync_user(*, notify=True)¶
Update all person data based on the current user data.
- Parameters
notify – Whether to trigger the
person_updated
signal.
- user¶
- user_id¶
- class indico.modules.events.models.persons.EventPersonLink(*args, **kwargs)¶
Association between EventPerson and Event.
Chairperson or speaker (lecture)
- display_order¶
- event_id¶
- id¶
- property is_submitter¶
- object_relationship_name = 'event'¶
The name of the relationship pointing to the object the person is linked to
- person¶
- person_id¶
- person_link_backref_name = 'event_links'¶
The name of the backref on the EventPerson
- person_link_unique_columns = ('event_id',)¶
The columns which should be included in the unique constraint.
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- class indico.modules.events.models.persons.PersonLinkBase(*args, **kwargs)¶
Base class for EventPerson associations.
- address¶
- affiliation¶
- affiliation_id¶
- affiliation_link¶
- display_order = Column(None, Integer(), table=None, nullable=False, default=ColumnDefault(0))¶
- property display_order_key¶
- property display_order_key_lastname¶
- property email¶
- first_name¶
- id = Column(None, Integer(), table=None, primary_key=True, nullable=False)¶
- last_name¶
- object¶
- object_relationship_name = None¶
The name of the relationship pointing to the object the person is linked to
- person = <RelationshipProperty at 0x7f170ba14740; no key>¶
- person_id = Column(None, Integer(), ForeignKey('events.persons.id'), table=None, nullable=False)¶
- person_link_backref_name = None¶
The name of the backref on the EventPerson
- person_link_unique_columns = None¶
The columns which should be included in the unique constraint.
- phone¶
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- title¶
The title of the user
- class indico.modules.events.models.persons.PersonLinkMixin¶
- person_link_backref_name = None¶
- property person_link_data¶
- person_link_relation_name = None¶
- person_links = <RelationshipProperty at 0x7f170ba40540; no key>¶
- property sorted_person_links¶
- class indico.modules.events.models.principals.EventPrincipal(**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.
- allow_category_roles = True¶
Whether it should be allowed to add a category role
- allow_emails = True¶
Whether it should be allowed to add a user by email address. This is useful in places where no Indico user exists yet. Usually adding an email address to an ACL should result in an email being sent to the user, inviting him to create an account with that email address.
- allow_event_roles = True¶
Whether it should be allowed to add an event role.
- allow_networks = True¶
Whether it should be allowed to add an IP network.
- allow_registration_forms = True¶
Whether it should be allowed to add registrants
- category_role¶
- category_role_id¶
- email¶
- event_id¶
The ID of the associated event
- event_role¶
- event_role_id¶
- full_access¶
- id¶
The ID of the acl entry
- ip_network_group¶
- ip_network_group_id¶
- local_group_id¶
- multipass_group_name¶
- multipass_group_provider¶
- permissions¶
- principal_backref_name = 'in_event_acls'¶
The name of the backref added to User and LocalGroup. For consistency, it is recommended to name the backref
in_foo_acl
with foo describing the ACL where this mixin is used.
- principal_for = 'Event'¶
The model for which we are a principal. May also be a string containing the model’s class name.
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- read_access¶
- registration_form¶
- registration_form_id¶
- type¶
- unique_columns = ('event_id',)¶
The columns which should be included in the unique constraints. If set to
None
, no unique constraints will be added.
- user_id¶
- class indico.modules.events.models.references.EventReference(**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.
- event_id¶
- id¶
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- reference_backref_name = 'event_references'¶
The name of the backref on the ReferenceType
- reference_type¶
- reference_type_id¶
- value¶
- class indico.modules.events.models.references.ReferenceModelBase(**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.
- id = Column(None, Integer(), table=None, primary_key=True, nullable=False)¶
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- reference_backref_name = None¶
The name of the backref on the ReferenceType
- reference_type = <RelationshipProperty at 0x7f170b8dacc0; no key>¶
- reference_type_id = Column(None, Integer(), ForeignKey('indico.reference_types.id'), table=None, nullable=False)¶
- property url¶
The URL of the referenced entity.
None
if no URL template is defined.
- property urn¶
The URN of the referenced entity.
None
if no scheme is defined.
- value = Column(None, String(), table=None, nullable=False)¶
- class indico.modules.events.models.references.ReferenceType(**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.
- id¶
The unique ID of the reference type
- 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.
- name¶
The name of the referenced system
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- scheme¶
The scheme used to build an URN for the reference
- url_template¶
A URL template to build a link to a referenced entity
- class indico.modules.events.models.reviews.ProposalCommentMixin¶
- can_edit(user)¶
- timeline_item_type = 'comment'¶
- class indico.modules.events.models.reviews.ProposalGroupProxy(group)¶
The object that the proposals can be grouped by.
It provides all necessary methods for building the URLs, displaying the grouping information, etc.
- property full_title¶
- full_title_attr = 'full_title'¶
- property id¶
- 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.
- property title¶
- title_attr = 'title'¶
- class indico.modules.events.models.reviews.ProposalMixin¶
Classes that represent a proposal object should extend this class (ex: Abstract, Paper).
- call_for_proposals_attr = None¶
Attribute to retrieve the object with access to the reviewing settings
- can_comment(user)¶
- can_review(user, check_state=False)¶
- property cfp¶
- create_comment_endpoint = None¶
- create_judgment_endpoint = None¶
- create_review_endpoint = None¶
- delete_comment_endpoint = None¶
- edit_comment_endpoint = None¶
- edit_review_endpoint = None¶
- get_delete_comment_url(comment)¶
- get_last_revision()¶
- get_revisions()¶
- get_save_comment_url(comment=None)¶
- get_save_judgment_url()¶
- get_save_review_url(group=None, review=None)¶
- property is_in_final_state¶
- proposal_type = None¶
A unique identifier to handle rendering differences between proposal types
- revisions_enabled = True¶
Whether there is support for multiple revisions per proposal or just one
- class indico.modules.events.models.reviews.ProposalReviewMixin¶
Mixin for proposal reviews.
Classes that represent a review of a proposal should extend this class (ex: AbstractReview, PaperReview).
- can_edit(user)¶
- property group¶
- group_attr = None¶
Object used to group reviews together
- group_proxy_cls¶
Proxy class to provide the necessary properties and methods to the review grouping object
alias of
ProposalGroupProxy
- revision¶
- revision_attr = None¶
The revision object that the review refers to
- property score¶
- timeline_item_type = 'review'¶
A unique identifier to handle rendering differences between timeline items
- class indico.modules.events.models.reviews.ProposalRevisionMixin¶
Properties and methods of a proposal revision.
- get_reviewed_for_groups(user, include_reviewed=False)¶
- get_reviewer_render_data(user)¶
- get_reviews(group=None, user=None)¶
- get_timeline(user=None)¶
- property proposal¶
- proposal_attr = None¶
The attribute of the revision used to fetch the proposal object.
- revisions_enabled = True¶
Whether the reviewing process supports multiple revisions per proposal. If set to false it is assumed that the reviewing process supports only one revision per proposal.
- class indico.modules.events.models.series.EventSeries(**kwargs)¶
A series of events.
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.
- event_title_pattern¶
A pattern to auto-generate event titles when cloning events from the series.
- id¶
The ID of the series
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- show_links¶
Whether to show links to the other events in the same series on the main event page.
- show_sequence_in_title¶
Whether to show the sequence number of an event in its title on category display pages and on the main event page.
- class indico.modules.events.models.settings.EventSetting(**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.
- event¶
- event_id¶
- id¶
- module¶
- name¶
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- settings_backref_name = 'settings'¶
- value¶
- class indico.modules.events.models.settings.EventSettingPrincipal(**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.
- allow_category_roles = True¶
Whether it should be allowed to add a category role
- allow_event_roles = True¶
Whether it should be allowed to add an event role.
- category_role¶
- category_role_id¶
- email = None¶
- event¶
- event_id¶
- event_role¶
- event_role_id¶
- extra_key_cols = ('event_id',)¶
- id¶
- ip_network_group = None¶
- ip_network_group_id = None¶
- local_group_id¶
- module¶
- multipass_group_name¶
- multipass_group_provider¶
- name¶
- principal_backref_name = 'in_event_settings_acls'¶
The name of the backref added to User and LocalGroup. For consistency, it is recommended to name the backref
in_foo_acl
with foo describing the ACL where this mixin is used.
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- registration_form = None¶
- registration_form_id = None¶
- settings_backref_name = 'settings_principals'¶
- type¶
- user_id¶
- class indico.modules.events.models.settings.EventSettingsMixin¶
- event = <RelationshipProperty at 0x7f170b69b6c0; no key>¶
- event_id = Column(None, Integer(), ForeignKey('events.events.id'), table=None, nullable=False)¶
- settings_backref_name = None¶
- class indico.modules.events.models.static_list_links.StaticListLink(**kwargs)¶
Display configuration data used in static links to listing pages.
This allows users to share links to listing pages in events while preserving e.g. column/filter configurations.
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.
- classmethod create(event, type_, data)¶
Create a new static list link.
If one exists with the same data, that link is used instead of creating a new one.
- Parameters
event – the Event for which to create the link
type – the type of the link
data – the data to associate with the link
- Returns
the newly created StaticListLink
- created_dt¶
- data¶
- event¶
- event_id¶
- id¶
- last_used_dt¶
- classmethod load(event, type_, uuid)¶
Load the data associated with a link.
- Parameters
event – the Event the link belongs to
type – the type of the link
uuid – the UUID of the link
- Returns
the link data or
None
if the link does not exist
- query: IndicoBaseQuery¶
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model)
. Can be customized per-model by overridingquery_class
.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())
instead.
- type¶
- uuid¶
Operations¶
- indico.modules.events.operations.clone_event(event, n_occurrence, start_dt, cloners, category=None, refresh_users=False)¶
Clone an event on a given date/time.
Runs all required cloners.
- Parameters
n_occurrence – The 1-indexed number of the occurrence, if this is a “recurring” clone, otherwise 0
start_dt – The start datetime of the new event;
cloners – A set containing the names of all enabled cloners;
category – The Category the new event will be created in.
- Aparam refresh_users
Whether EventPerson data should be updated from their linked User object
- indico.modules.events.operations.clone_into_event(source_event, target_event, cloners)¶
Clone data into an existing event.
Runs all required cloners.
- Parameters
source_event – The Event to clone data from;
target_event – The Event to clone data into;
cloners – A set containing the names of all enabled cloners.
- indico.modules.events.operations.create_event(category, event_type, data, add_creator_as_manager=True, features=None, cloning=False)¶
Create a new event.
- Parameters
category – The category in which to create the event
event_type – An EventType value
data – A dict containing data used to populate the event
add_creator_as_manager – Whether the creator (current user) should be added as a manager
features – A list of features that will be enabled for the event. If set, only those features will be used and the default feature set for the event type will be ignored.
cloning – Whether the event is created via cloning or not
- indico.modules.events.operations.create_event_label(data)¶
- indico.modules.events.operations.create_event_references(event, data)¶
- indico.modules.events.operations.create_event_request(event, category, comment='')¶
- indico.modules.events.operations.create_reference_type(data)¶
- indico.modules.events.operations.create_reviewing_question(event, question_model, wtf_field_cls, form, data=None)¶
- indico.modules.events.operations.delete_event_label(event_label)¶
- indico.modules.events.operations.delete_reference_type(reference_type)¶
- indico.modules.events.operations.delete_reviewing_question(question)¶
- indico.modules.events.operations.lock_event(event)¶
- indico.modules.events.operations.sort_reviewing_questions(questions, new_positions)¶
- indico.modules.events.operations.unlock_event(event)¶
- indico.modules.events.operations.update_event(event, *, update_timetable=False, _extra_log_fields=None, **data)¶
- indico.modules.events.operations.update_event_label(event_label, data)¶
- indico.modules.events.operations.update_event_privacy(event, data)¶
- indico.modules.events.operations.update_event_protection(event, data, *, _extra_log_fields=None)¶
- indico.modules.events.operations.update_event_type(event, type_)¶
- indico.modules.events.operations.update_reference_type(reference_type, data)¶
- indico.modules.events.operations.update_reviewing_question(question, form)¶
Utilities¶
- class indico.modules.events.util.ListGeneratorBase(event, entry_parent=None)¶
Base class for classes performing actions on Indico object lists.
- Parameters
event – The associated Event
entry_parent – The parent of the entries of the list. If it’s None, the parent is assumed to be the event itself.
- default_list_config = None¶
The default list configuration dictionary
- endpoint = None¶
The endpoint of the list management page
- entry_parent¶
The parent object of the list items
- event¶
The event the list is associated with
- flash_info_message(obj)¶
- generate_static_url()¶
Return a URL with a uuid referring to the list’s configuration.
- get_list_url(uuid=None, external=False)¶
Return the URL of the list management page.
- list_link_type = None¶
Unique list identifier
- static_items¶
Columns that originate from the list item’s properties, relationships etc, but not from user defined fields (e.g. registration/contribution fields)
- store_configuration()¶
Load the filters from the request and store them in the session.
- class indico.modules.events.util.ZipGeneratorMixin¶
Mixin for RHs that generate zip with files.
- indico.modules.events.util.check_event_locked(rh, event, force=False)¶
- indico.modules.events.util.check_permissions(event, field, allow_networks=False)¶
- indico.modules.events.util.create_event_logo_tmp_file(event, tmpdir=None)¶
Create a temporary file with the event’s logo.
If tmpdir is specified, the logo file is created in there and a path relative to that directory is returned.
- indico.modules.events.util.format_log_person(data)¶
- indico.modules.events.util.format_log_ref(ref)¶
- indico.modules.events.util.get_all_user_roles(event, user)¶
- indico.modules.events.util.get_event_from_url(url)¶
Get an event from an Indico event URL.
- indico.modules.events.util.get_events_created_by(user, dt=None)¶
Get the IDs of events created by the user.
- Parameters
user – A User
dt – Only include events taking place on/after that date
- Returns
A set of event ids
- indico.modules.events.util.get_events_managed_by(user, dt=None)¶
Get the IDs of events where the user has management privs.
- Parameters
user – A User
dt – Only include events taking place on/after that date
- Returns
A set of event ids
- indico.modules.events.util.get_events_with_linked_event_persons(user, dt=None)¶
Return a dict containing the event ids and role for all events where the user is a chairperson or (in case of a lecture) speaker.
- Parameters
user – A User
dt – Only include events taking place on/after that date
- indico.modules.events.util.get_field_values(form_data)¶
Split the form fields between custom and static.
- indico.modules.events.util.get_object_from_args(args=None)¶
Retrieve an event object from request arguments.
This utility is meant to be used in cases where the same controller can deal with objects attached to various parts of an event which use different URLs to indicate which object to use.
- Parameters
args – The request arguments. If unspecified,
request.view_args
is used.- Returns
An
(object_type, event, object)
tuple. The event is always theEvent
associated with the object. The object may be an Event, Session, SessionBlock, Contribution or SubContribution. If the object does not exist,(object_type, None, None)
is returned.
- indico.modules.events.util.get_random_color(event)¶
- indico.modules.events.util.get_theme(event, override_theme_id=None)¶
Get the theme ID and whether it’s an override.
This is useful for places where a user may specify a different timetable theme. If the override theme is not valid for the event, a message is flashed and an exception redirecting the user to the main event page is raised.
- Raises
BadRequest – if the override theme id is not valid
- Returns
a
(theme_id, is_override)
tuple
- indico.modules.events.util.register_event_time_change(event)¶
Register a time-related change for an event.
This is an internal helper function used in the model to record changes of the start time or end time. The changes are exposed through the track_time_changes contextmanager function.
- indico.modules.events.util.register_location_change(entry)¶
Register a location-related change for an event object.
This is an internal helper function used in the models to record changes of the location information. The changes are exposed through the track_location_changes contextmanager function.
- indico.modules.events.util.register_time_change(entry)¶
Register a time-related change for a timetable entry.
This is an internal helper function used in the models to record changes of the start time or duration. The changes are exposed through the track_time_changes contextmanager function.
- indico.modules.events.util.serialize_event_for_ical(event)¶
- indico.modules.events.util.serialize_event_for_json_ld(event, full=False)¶
- indico.modules.events.util.serialize_events_for_json_ld(events, *, full=False)¶
- indico.modules.events.util.serialize_person_for_json_ld(person)¶
- indico.modules.events.util.set_custom_fields(obj, custom_fields_data)¶
- indico.modules.events.util.should_show_draft_warning(event)¶
- indico.modules.events.util.split_log_location_changes(changes)¶
- indico.modules.events.util.track_location_changes()¶
Track location changes of event objects.
This provides a list of changes while the context manager was active and also triggers location_changed signals.
If the code running inside the
with
block of this context manager raises an exception, no signals will be triggered.
- indico.modules.events.util.track_time_changes(auto_extend=False, user=None)¶
Track time changes of event objects.
This provides a list of changes while the context manager was active and also triggers times_changed signals.
If the code running inside the
with
block of this context manager raises an exception, no signals will be triggered.- Parameters
auto_extend – Whether entry parents will get their boundaries automatically extended or not. Passing
'start'
will extend only start datetime,'end'
to extend only end datetime.user – The User that will trigger time changes.
- indico.modules.events.util.update_object_principals(obj, new_principals, read_access=False, full_access=False, permission=None)¶
Update an object’s ACL with a new list of principals.
Exactly one argument out of read_access, full_access and role must be specified.
- Parameters
obj – The object to update. Must have
acl_entries
new_principals – The set containing the new principals
read_access – Whether the read access ACL should be updated
full_access – Whether the full access ACL should be updated
permission – The role ACL that should be updated
Settings¶
- class indico.modules.events.settings.EventACLProxy(proxy)¶
Proxy class for event-specific ACL settings.
- add_principal(event, name, principal)¶
Add a principal to an ACL.
- Parameters
event – Event (or its ID)
name – Setting name
principal – A
User
or aGroupProxy
- contains_user(event, name, user)¶
Check if a user is in an ACL.
To pass this check, the user can either be in the ACL itself or in a group in the ACL.
- Parameters
event – Event (or its ID)
name – Setting name
user – A
User
- get(event, name)¶
Retrieves an ACL setting
- Parameters
event – Event (or its ID)
name – Setting name
- merge_users(target, source)¶
Replace all ACL user entries for source with target.
- remove_principal(event, name, principal)¶
Remove a principal from an ACL.
- Parameters
event – Event (or its ID)
name – Setting name
principal – A
User
or aGroupProxy
- set(event, name, acl)¶
Replace an ACL with a new one.
- Parameters
event – Event (or its ID)
name – Setting name
acl – A set containing principals (users/groups)
- class indico.modules.events.settings.EventSettingProperty(proxy, name, default=<object object>, attr=None)¶
- attr = 'event'¶
- class indico.modules.events.settings.EventSettingsProxy(module, defaults=None, strict=True, acls=None, converters=None)¶
Proxy class to access event-specific settings for a certain module.
- acl_proxy_class¶
alias of
EventACLProxy
- delete(event, *names)¶
Delete settings.
- Parameters
event – Event (or its ID)
names – One or more names of settings to delete
- delete_all(event)¶
Delete all settings.
- Parameters
event – Event (or its ID)
- get(event, name, default=<object object>)¶
Retrieve the value of a single setting.
- Parameters
event – Event (or its ID)
name – Setting name
default – Default value in case the setting does not exist
- Returns
The settings’s value or the default value
- get_all(event, no_defaults=False)¶
Retrieve all settings.
- Parameters
event – Event (or its ID)
no_defaults – Only return existing settings and ignore defaults.
- Returns
Dict containing the settings
- property query¶
Return a query object filtering by the proxy’s module.
- set(event, name, value)¶
Set a single setting.
- Parameters
event – Event (or its ID)
name – Setting name
value – Setting value; must be JSON-serializable
- set_multi(event, items)¶
Set multiple settings at once.
- Parameters
event – Event (or its ID)
items – Dict containing the new settings
- class indico.modules.events.settings.ThemeSettingsProxy¶
- property defaults¶
- get_themes_for(event_type)¶
- property settings¶
- property themes¶
- indico.modules.events.settings.event_or_id(f)¶