Contribution

Todo

Docstrings (module, models, operations, utilities)

Models

class indico.modules.events.contributions.models.contributions.Contribution(**kwargs)

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

ATTACHMENT_FOLDER_ID_COLUMN = u'contribution_id'
PRELOAD_EVENT_ATTACHED_ITEMS = True
PRELOAD_EVENT_NOTES = True
abstract
abstract_id
access_key = None
acl_entries
allow_relationship_preloading = True
board_number
can_manage(user, role=None, allow_admin=True, check_parent=True, explicit_role=False)
default_render_mode = 2
disallowed_protection_modes = frozenset([])
duration
duration_display

The displayed duration of the contribution.

This is the duration of the poster session if applicable, otherwise the duration of the contribution itself.

duration_poster
end_dt
end_dt_display

The displayed end time of the contribution.

This is the end time of the poster session if applicable, otherwise the end time of the contribution itself.

end_dt_poster
event
event_id
field_values

Data stored in abstract/contribution fields

friendly_id

The human-friendly ID for the contribution

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_paper_reviewer(user)
is_scheduled
is_user_associated(user, check_abstract=False)
keywords
location_backref_name = u'contributions'
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
paper
paper_content_reviewers

Paper content reviewers

paper_judges

Paper reviewing judges

paper_layout_reviewers

Paper layout reviewers

pending_paper_files

Paper files not submitted for reviewing

Persons associated with this contribution

possible_render_modes = set([<RenderMode.html: 1>, <RenderMode.markdown: 2>])
classmethod preload_acl_entries(event)
protection_mode
protection_parent
references

External references associated with this contribution

render_mode
session
session_block
session_block_id
session_id
start_dt
start_dt_display

The displayed start time of the contribution.

This is the start time of the poster session if applicable, otherwise the start time of the contribution itself.

start_dt_poster
subcontribution_count
subcontributions
submitters
title
track
track_id
type
type_id
verbose_title
class indico.modules.events.contributions.models.contributions.CustomFieldsMixin

Bases: object

Methods to process custom field data.

get_field_value(field_id, raw=False)
set_custom_field(field_id, field_value)
class indico.modules.events.contributions.models.fields.ContributionField(**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.

description
event
event_id
field
field_data
field_type
filter_choices
id
is_active
is_required
legacy_id
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.

mgmt_field
position
title
class indico.modules.events.contributions.models.fields.ContributionFieldValue(**kwargs)

Bases: indico.modules.events.contributions.models.fields.ContributionFieldValueBase

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.

contribution_field
contribution_field_backref_name = u'contribution_values'
contribution_field_id
contribution_id
data
class indico.modules.events.contributions.models.fields.ContributionFieldValueBase(**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.

contribution_field = <RelationshipProperty at 0x7fe102fb6b78; no key>
contribution_field_backref_name = None

The name of the backref on the ContributionField

contribution_field_id
data = Column(None, JSON(astext_type=Text()), table=None, nullable=False)
friendly_data
class indico.modules.events.contributions.models.persons.AuthorType

Bases: int, indico.util.struct.enum.IndicoEnum

classmethod get_highest(*types)
none = 0
primary = 1
secondary = 2

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

Association between EventPerson and Contribution.

author_type
contribution_id
display_order
id
is_author
is_speaker
is_submitter
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.

object_relationship_name = u'contribution'
person
person_id

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

Association between EventPerson and SubContribution.

author_type = 0
display_order
id
is_speaker = True
object_relationship_name = u'subcontribution'
person
person_id
subcontribution_id
class indico.modules.events.contributions.models.principals.ContributionPrincipal(**kwargs)

Bases: indico.core.db.sqlalchemy.principals.PrincipalRolesMixin, 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_emails = True
contribution_id

The ID of the associated contribution

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_contribution_acls'
principal_for = u'Contribution'
read_access
roles
type
unique_columns = (u'contribution_id',)
user
user_id
class indico.modules.events.contributions.models.references.ContributionReference(**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.

contribution_id
id
reference_backref_name = u'contribution_references'
reference_type
reference_type_id
value
class indico.modules.events.contributions.models.references.SubContributionReference(**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.

id
reference_backref_name = u'subcontribution_references'
reference_type
reference_type_id
subcontribution_id
value
class indico.modules.events.contributions.models.subcontributions.SubContribution(**kwargs)

Bases: indico.core.db.sqlalchemy.descriptions.DescriptionMixin, indico.core.db.sqlalchemy.attachments.AttachedItemsMixin, indico.core.db.sqlalchemy.notes.AttachedNotesMixin, sqlalchemy.ext.declarative.api.Model

ATTACHMENT_FOLDER_ID_COLUMN = u'subcontribution_id'
PRELOAD_EVENT_ATTACHED_ITEMS = True
PRELOAD_EVENT_NOTES = True
can_access(user, **kwargs)
can_manage(user, role=None, **kwargs)
contribution_id
default_render_mode = 2
duration
event
friendly_id

The human-friendly ID for the sub-contribution

get_access_list()
get_manager_list(recursive=False)
id
is_deleted
is_protected
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.

Persons associated with this contribution

position
possible_render_modes = set([<RenderMode.html: 1>, <RenderMode.markdown: 2>])
references

External references associated with this contribution

render_mode
session

Convenience property so all event entities have it

speakers
timetable_entry

Convenience property so all event entities have it

title
class indico.modules.events.contributions.models.types.ContributionType(**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.

description
event
event_id
id
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.

name

Operations

indico.modules.events.contributions.operations.create_contribution(event, contrib_data, custom_fields_data=None, session_block=None, extend_parent=False)
indico.modules.events.contributions.operations.create_contribution_from_abstract(*args, **kwargs)
indico.modules.events.contributions.operations.create_subcontribution(contrib, data)
indico.modules.events.contributions.operations.delete_contribution(contrib)
indico.modules.events.contributions.operations.delete_subcontribution(subcontrib)
indico.modules.events.contributions.operations.update_contribution(*args, **kwargs)

Update a contribution

Parameters:
  • contrib – The Contribution to update
  • contrib_data – A dict containing the data to update
  • custom_fields_data – A dict containing the data for custom fields.
Returns:

A dictionary containing information related to the update. unscheduled will be true if the modification resulted in the contribution being unscheduled. In this case undo_unschedule contains the necessary data to re-schedule it (undoing the session change causing it to be unscheduled)

indico.modules.events.contributions.operations.update_subcontribution(subcontrib, data)

Utilities

indico.modules.events.contributions.util.contribution_type_row(contrib_type)
indico.modules.events.contributions.util.generate_spreadsheet_from_contributions(contributions)

Return a tuple consisting of spreadsheet columns and respective contribution values

indico.modules.events.contributions.util.get_contribution_ical_file(contrib)
indico.modules.events.contributions.util.get_contributions_with_user_as_submitter(event, user)

Get a list of contributions in which the user has submission rights

indico.modules.events.contributions.util.get_events_with_linked_contributions(user, dt=None)

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

Parameters:
  • user – A User
  • dt – Only include events taking place on/after that date
indico.modules.events.contributions.util.has_contributions_with_user_as_submitter(event, user)
indico.modules.events.contributions.util.make_contribution_form(event)

Extends the contribution WTForm to add the extra fields.

Each extra field will use a field named custom_ID.

Parameters:event – The Event for which to create the contribution form.
Returns:A ContributionForm subclass.
indico.modules.events.contributions.util.serialize_contribution_for_ical(contrib)

Serialize ContributionPersonLink to JSON-like object