Session

Todo

Docstrings (module, models, operations, utilities)

Models

class indico.modules.events.sessions.models.sessions.Session(**kwargs)

Bases: indico.core.db.sqlalchemy.descriptions.DescriptionMixin, indico.core.db.sqlalchemy.colors.ColorMixin, indico.core.db.sqlalchemy.protection.ProtectionManagersMixin, indico.core.db.sqlalchemy.locations.LocationMixin, indico.core.db.sqlalchemy.attachments.AttachedItemsMixin, indico.core.db.sqlalchemy.notes.AttachedNotesMixin, flask_sqlalchemy.Model

ATTACHMENT_FOLDER_ID_COLUMN = u'session_id'
PRELOAD_EVENT_ATTACHED_ITEMS = True
PRELOAD_EVENT_NOTES = True
access_key = None
acl_entries
allow_relationship_preloading = True
background_color
blocks
can_manage_blocks(user, allow_admin=True)

Check whether a user can manage session blocks.

This only applies to the blocks themselves, not to contributions inside them.

can_manage_contributions(user, allow_admin=True)

Check whether a user can manage contributions within the session.

code
conveners
default_colors = ColorTuple(text=u'202020', background=u'e3f2d3')
default_contribution_duration
default_render_mode = 2
disallowed_protection_modes = frozenset([])
end_dt
event_id
event_new
friendly_id

The human-friendly ID for the session

get_non_inheriting_objects()

Get a set of child objects that do not inherit protection

id
inherit_location
inheriting_have_acl = True
is_deleted
is_poster
location_backref_name = u'sessions'
location_parent
locator

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

own_address
own_no_access_contact = None
own_room
own_room_id
own_room_name
own_venue
own_venue_id
own_venue_name
possible_render_modes = set([<RenderMode.markdown: 2>])
classmethod preload_acl_entries(event)
protection_mode
protection_parent
render_mode = 2
session

Convenience property so all event entities have it

start_dt
text_color
title
class indico.modules.events.sessions.models.blocks.SessionBlock(**kwargs)

Bases: indico.core.db.sqlalchemy.locations.LocationMixin, flask_sqlalchemy.Model

can_access(user, allow_admin=True)
can_edit_note(user)
can_manage(user, allow_admin=True)
can_manage_attachments(user)
contribution_count
duration
end_dt
event_new
full_title
has_note
id
inherit_location
location_backref_name = u'session_blocks'
location_parent
locator

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

note
own_address
own_room
own_room_id
own_room_name
own_venue
own_venue_id
own_venue_name

Persons associated with this session block

session_id
start_dt
timetable_entry
title

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

Association between EventPerson and SessionBlock.

Also known as a ‘session convener’

display_order
id
object_relationship_name = u'session_block'
person
person_id
session_block_id
class indico.modules.events.sessions.models.principals.SessionPrincipal(**kwargs)

Bases: indico.core.db.sqlalchemy.principals.PrincipalRolesMixin, flask_sqlalchemy.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_emails = True
disallowed_protection_modes = frozenset([])
email
full_access
id

The ID of the acl entry

ip_network_group = None
ip_network_group_id = None
local_group
local_group_id
multipass_group_name
multipass_group_provider
principal_backref_name = u'in_session_acls'
principal_for = u'Session'
read_access
roles
session_id

The ID of the associated session

type
unique_columns = (u'session_id',)
user
user_id

Operations

indico.modules.events.sessions.operations.create_session(event, data)

Create a new session with the information passed in the data argument

indico.modules.events.sessions.operations.create_session_block(session_, data)
indico.modules.events.sessions.operations.delete_session(event_session)

Delete session from the event

indico.modules.events.sessions.operations.delete_session_block(session_block)
indico.modules.events.sessions.operations.update_session(event_session, data)

Update a session based on the information in the data

indico.modules.events.sessions.operations.update_session_block(session_block, data)

Update a session block with data passed in the data argument

indico.modules.events.sessions.operations.update_session_coordinator_privs(event, data)

Utilities

class indico.modules.events.sessions.util.SessionListToPDF(conf, sessions)

Bases: indico.legacy.pdfinterface.base.PDFBase

getBody(story=None)
indico.modules.events.sessions.util.can_manage_sessions(user, event, role=None)

Check whether a user can manage any sessions in an event

indico.modules.events.sessions.util.generate_pdf_from_sessions(event, sessions)

Generate a PDF file from a given session list

indico.modules.events.sessions.util.generate_spreadsheet_from_sessions(sessions)

Generate spreadsheet data from a given session list.

Parameters:sessions – The sessions to include in the spreadsheet
indico.modules.events.sessions.util.get_events_with_linked_sessions(user, dt=None)

Returns a dict with keys representing event_id and the values containing data about the user rights for sessions within the event

Parameters:
  • user – A User
  • dt – Only include events taking place on/after that date
indico.modules.events.sessions.util.get_session_ical_file(sess)
indico.modules.events.sessions.util.get_session_timetable_pdf(sess, **kwargs)
indico.modules.events.sessions.util.get_sessions_for_user(event, user)
indico.modules.events.sessions.util.has_sessions_for_user(event, user)
indico.modules.events.sessions.util.serialize_session_for_ical(sess)
indico.modules.events.sessions.util.session_coordinator_priv_enabled(event, priv)

Check whether a coordinator privilege is enabled.

Currently the following privileges are available:

  • manage-contributions
  • manage-blocks
Parameters:
  • event – The Event to check for
  • priv – The name of the privilege