Event

Todo

Docstrings (module, models, operations, utilities, settings)

Models

class indico.modules.events.models.events.Event(**kwargs)

Bases: indico.core.db.sqlalchemy.searchable_titles.SearchableTitleMixin, indico.core.db.sqlalchemy.descriptions.DescriptionMixin, indico.core.db.sqlalchemy.locations.LocationMixin, indico.core.db.sqlalchemy.protection.ProtectionManagersMixin, indico.core.db.sqlalchemy.attachments.AttachedItemsMixin, indico.core.db.sqlalchemy.notes.AttachedNotesMixin, indico.modules.events.models.persons.PersonLinkDataMixin, sqlalchemy.ext.declarative.api.Model

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 = u'event_id'
abstracts
access_key
acl_entries

The ACL entries for the event

additional_info
allow_access_key = True
allow_location_inheritance = False
allow_no_access_contact = True
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.

Parameters:category_ids – A list of category ids or a single category id
category_id

The ID of immediate parent category of the event

cfa
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)

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([])
display_tzinfo

The tzinfo of the event as preferred by the current user.

duration
editable_types
end_dt

The end date of the event

end_dt_display

The ‘displayed end dt’, which is usually the actual end dt, but may be overridden for a conference.

end_dt_local
end_dt_override
ends_after(dt)

Check whether the event ends on/after the specified date.

event

Convenience property so all event entities have it.

external_logo_url
external_url
get_allowed_sender_emails(include_current_user=True, include_creator=True, include_managers=True, include_contact=True, include_chairs=True, 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)
  • extra – An email address that is always included, even if it is not in any of the included lists.
Returns:

An OrderedDict mapping emails to pretty names

get_contribution(id_)

Get a contribution of the event.

get_contribution_field(field_id)
get_label_markup(size=u'')
get_non_inheriting_objects()

Get a set of child objects that do not inherit protection.

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 and next.
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.

has_custom_boa
has_ended
has_feature(**kwargs)

Check if a feature is enabled for the event.

has_regform_in_acl
has_stylesheet
id

The ID of the event

inherit_location = False
inheriting_have_acl = True
is_deleted

If the event has been deleted

is_locked

If the event is locked (read-only mode)

is_user_registered(user)

Check whether the user is registered in the event.

This takes both unpaid and complete registrations into account.

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
legacy_mapping
location_backref_name = u'events'
locator
log(realm, kind, module, summary, user=None, type_=u'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 EventLogKind 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 of key, value pairs which will be displayed in the given order.

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.

The logo’s raw image data

logo_metadata

The metadata of the logo (hash, size, filename, content_type)

logo_url
map_url
move(category)
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
participation_regform

Persons associated with this event

possible_render_modes = set([<RenderMode.html: 1>])
preload_all_acl_entries()
protection_mode
protection_parent
public_regform_access
published_registrations
references

External references associated with this event

registrations
render_mode = 1
reservations
scheduled_notes
series

The series this event is part of

series_id

The ID of the series this events belongs to

short_external_url
short_url
start_dt

The start date of the event

start_dt_display

The ‘displayed start dt’, which is usually the actual start dt, but may be overridden for a conference.

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)

theme
timezone

The timezone of the event

title
type
type_
tzinfo
url
url_shortcut

The URL shortcut for the event

visibility

The visibility depth in category overviews

class indico.modules.events.models.events.EventType

Bases: indico.util.struct.enum.RichIntEnum

conference = 3
lecture = 1
legacy_name
meeting = 2
class indico.modules.events.models.persons.AuthorsSpeakersMixin

Bases: object

AUTHORS_SPEAKERS_DISPLAY_ORDER_ATTR = u'display_order_key'
primary_authors
secondary_authors
speakers
class indico.modules.events.models.persons.EventPerson(**kwargs)

Bases: indico.modules.users.models.users.PersonMixin, sqlalchemy.ext.declarative.api.Model

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
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.

has_role(role, obj)

Whether the person has a role in the ACL list of a given object.

id
invited_dt
is_untrusted
last_name

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 passing obj.locator.other to the code expecting an object with a locator.

merge_person_info(**kwargs)
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
principal
user
user_id

Bases: indico.modules.events.models.persons.PersonLinkBase

Association between EventPerson and Event.

Chairperson or speaker (lecture)

display_order
event_id
id
is_submitter
object_relationship_name = u'event'
person
person_id
class indico.modules.events.models.persons.PersonLinkBase(*args, **kwargs)

Bases: indico.modules.users.models.users.PersonMixin, sqlalchemy.ext.declarative.api.Model

Base class for EventPerson associations.

address
affiliation
display_order = Column(None, Integer(), table=None, nullable=False, default=ColumnDefault(0))
display_order_key
display_order_key_lastname
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 0x7fc3d2d47830; no key>
person_id = Column(None, Integer(), ForeignKey(u'events.persons.id'), table=None, nullable=False)

The name of the backref on the EventPerson

The columns which should be included in the unique constraint.

phone
title
class indico.modules.events.models.persons.PersonLinkDataMixin

Bases: object

class indico.modules.events.models.principals.EventPrincipal(**kwargs)

Bases: indico.core.db.sqlalchemy.principals.PrincipalPermissionsMixin, sqlalchemy.ext.declarative.api.Model

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
allow_emails = True
allow_event_roles = True
allow_networks = True
allow_registration_forms = True
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
local_group_id
multipass_group_name
multipass_group_provider
permissions
principal_backref_name = u'in_event_acls'
principal_for = u'Event'
read_access
registration_form
registration_form_id
type
unique_columns = (u'event_id',)
user
user_id
class indico.modules.events.models.references.EventReference(**kwargs)

Bases: indico.modules.events.models.references.ReferenceModelBase

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
reference_backref_name = u'event_references'
reference_type
reference_type_id
value
class indico.modules.events.models.references.ReferenceModelBase(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Model

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)
reference_backref_name = None

The name of the backref on the ReferenceType

reference_type = <RelationshipProperty at 0x7fc3d2c0e950; no key>
reference_type_id = Column(None, Integer(), ForeignKey(u'indico.reference_types.id'), table=None, nullable=False)
url

The URL of the referenced entity.

None if no URL template is defined.

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)

Bases: sqlalchemy.ext.declarative.api.Model

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 passing obj.locator.other to the code expecting an object with a locator.

name

The name of the referenced system

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

Bases: object

can_edit(user)
timeline_item_type = u'comment'
class indico.modules.events.models.reviews.ProposalGroupProxy(group)

Bases: object

The object that the proposals can be grouped by.

It provides all necessary methods for building the URLs, displaying the grouping information, etc.

full_title
full_title_attr = u'full_title'
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.

title
title_attr = u'title'
class indico.modules.events.models.reviews.ProposalMixin

Bases: object

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)
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)
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

Bases: object

Mixin for proposal reviews.

Classes that represent a review of a proposal should extend this class (ex: AbstractReview, PaperReview).

can_edit(user)
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

score
timeline_item_type = u'review'

A unique identifier to handle rendering differences between timeline items

class indico.modules.events.models.reviews.ProposalRevisionMixin

Bases: object

Properties and methods of a proposal revision.

get_reviewed_for_groups(user, include_reviewed=False)
get_reviewer_render_data(**kwargs)
get_reviews(group=None, user=None)
get_timeline(user=None)
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)

Bases: sqlalchemy.ext.declarative.api.Model

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.

id

The ID of the series

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)

Bases: indico.core.settings.models.base.JSONSettingsBase, indico.modules.events.models.settings.EventSettingsMixin, sqlalchemy.ext.declarative.api.Model

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
settings_backref_name = u'settings'
value
class indico.modules.events.models.settings.EventSettingPrincipal(**kwargs)

Bases: indico.core.settings.models.base.PrincipalSettingsBase, indico.modules.events.models.settings.EventSettingsMixin, sqlalchemy.ext.declarative.api.Model

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
allow_event_roles = True
category_role
category_role_id
email = None
event
event_id
event_role
event_role_id
extra_key_cols = (u'event_id',)
id
ip_network_group = None
ip_network_group_id = None
local_group
local_group_id
module
multipass_group_name
multipass_group_provider
name
principal_backref_name = u'in_event_settings_acls'
registration_form = None
registration_form_id = None
settings_backref_name = u'settings_principals'
type
user
user_id
class indico.modules.events.models.settings.EventSettingsMixin

Bases: object

event = <RelationshipProperty at 0x7fc3d2d90680; no key>
event_id = Column(None, Integer(), ForeignKey(u'events.events.id'), table=None, nullable=False)
settings_backref_name = None

Bases: sqlalchemy.ext.declarative.api.Model

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

type
uuid

Operations

indico.modules.events.operations.clone_event(event, n_occurrence, start_dt, cloners, category=None)

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.
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(*args, **kwargs)

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_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, **data)
indico.modules.events.operations.update_event_label(event_label, data)
indico.modules.events.operations.update_event_protection(event, data)
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)

Bases: object

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 = None

The parent object of the list items

event = None

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.

Unique list identifier

static_items = None

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

Bases: object

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, allow_registration_forms=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.get_all_user_roles(*args, **kwargs)
indico.modules.events.util.get_base_ical_parameters(user, detail, path, params=None)

Return a dict of all parameters expected by iCal template.

indico.modules.events.util.get_event_from_url(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 the Event associated with the object. The object may be an Event, Session, 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_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, detail_level)
indico.modules.events.util.serialize_event_for_json_ld(event, full=False)
indico.modules.events.util.serialize_event_person(person)

Serialize EventPerson to JSON-like object.

indico.modules.events.util.serialize_person_for_json_ld(person)

Serialize PersonLink to JSON-like object.

indico.modules.events.util.set_custom_fields(obj, custom_fields_data)
indico.modules.events.util.track_time_changes(*args, **kwds)

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)

Bases: indico.core.settings.proxy.ACLProxyBase

Proxy class for event-specific ACL settings.

add_principal(event, *args, **kwargs)

Add a principal to an ACL.

Parameters:
  • event – Event (or its ID)
  • name – Setting name
  • principal – A User or a GroupProxy
contains_user(event, *args, **kwargs)

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, *args, **kwargs)

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, *args, **kwargs)

Remove a principal from an ACL.

Parameters:
  • event – Event (or its ID)
  • name – Setting name
  • principal – A User or a GroupProxy
set(event, *args, **kwargs)

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)

Bases: indico.core.settings.proxy.SettingProperty

attr = u'event'
class indico.modules.events.settings.EventSettingsProxy(module, defaults=None, strict=True, acls=None, converters=None)

Bases: indico.core.settings.proxy.SettingsProxyBase

Proxy class to access event-specific settings for a certain module.

acl_proxy_class

alias of EventACLProxy

delete(event, *args, **kwargs)

Delete settings.

Parameters:
  • event – Event (or its ID)
  • names – One or more names of settings to delete
delete_all(event, *args, **kwargs)

Delete all settings.

Parameters:event – Event (or its ID)
get(event, *args, **kwargs)

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, *args, **kwargs)

Retrieve all settings.

Parameters:
  • event – Event (or its ID)
  • no_defaults – Only return existing settings and ignore defaults.
Returns:

Dict containing the settings

query

Return a query object filtering by the proxy’s module.

set(event, *args, **kwargs)

Set a single setting.

Parameters:
  • event – Event (or its ID)
  • name – Setting name
  • value – Setting value; must be JSON-serializable
set_multi(event, *args, **kwargs)

Set multiple settings at once.

Parameters:
  • event – Event (or its ID)
  • items – Dict containing the new settings
class indico.modules.events.settings.ThemeSettingsProxy

Bases: object

defaults
get_themes_for(**kwargs)
settings
themes
indico.modules.events.settings.event_or_id(f)