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
¶
-
classmethod
allocate_friendly_ids
(event, n)¶ Allocate n Contribution friendly_ids.
This is needed so that we can allocate all IDs in one go. Not doing so could result in DB deadlocks. All operations that create more than one contribution should use this method.
Parameters: - event – the
Event
in question - n – the number of ids to pre-allocate
- event – the
-
allow_relationship_preloading
= True¶
-
allowed_types_for_editable
¶
-
board_number
¶
-
can_manage
(user, permission=None, allow_admin=True, check_parent=True, explicit_permission=False)¶
-
can_submit_proceedings
(user)¶ Whether the user can submit editables/papers.
-
code
¶
-
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
¶
-
enabled_editables
¶ Return all submitted editables with enabled types.
-
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_editable
(editable_type)¶ Get the editable of the given type.
-
get_non_inheriting_objects
()¶ Get a set of child objects that do not inherit protection.
-
has_published_editables
¶
-
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
¶ Define a smart locator property.
This behaves pretty much like a normal read-only property and the decorated function should return a dict containing the necessary data to build a URL for the object.
This decorator should usually be applied to a method named
locator
as this name is required for get_locator to find it automatically when just passing the object.If you need more than one locator, you can define it like this:
@locator_property def locator(self): return {...} @locator.other def locator(self): return {...}
The
other
locator can then be accessed by passingobj.locator.other
to the code expecting an object with a locator.
-
log
(*args, **kwargs)¶ Log with prefilled metadata for the contribution.
-
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
-
person_links
¶ 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_public
¶
-
is_required
¶
-
is_user_editable
¶
-
legacy_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.
-
mgmt_field
¶
-
position
¶
-
title
¶
-
visibility
¶
-
-
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 0x7fc3d33d1b00; no key>¶
-
contribution_field_backref_name
= None¶ The name of the backref on the ContributionField
-
contribution_field_id
¶
-
data
= Column(None, JSONB(astext_type=Text()), table=None, nullable=False)¶
-
friendly_data
¶
-
-
class
indico.modules.events.contributions.models.fields.
ContributionFieldVisibility
¶ Bases:
indico.util.struct.enum.RichIntEnum
-
managers_and_submitters
= 2¶
-
managers_only
= 3¶
-
public
= 1¶
-
-
class
indico.modules.events.contributions.models.persons.
AuthorType
¶ Bases:
int
,indico.util.struct.enum.IndicoEnum
-
get_highest
= <bound method EnumMeta.get_highest of <enum 'AuthorType'>>¶
-
none
= 0¶
-
primary
= 1¶
-
secondary
= 2¶
-
-
class
indico.modules.events.contributions.models.persons.
ContributionPersonLink
(*args, **kwargs)¶ Bases:
indico.modules.events.models.persons.PersonLinkBase
Association between EventPerson and Contribution.
-
contribution_id
¶
-
display_order
¶
-
id
¶
-
is_speaker
¶
-
is_submitter
¶
-
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.
-
object_relationship_name
= u'contribution'¶
-
person
¶
-
person_id
¶
-
person_link_backref_name
= u'contribution_links'¶
-
person_link_unique_columns
= (u'contribution_id',)¶
-
-
class
indico.modules.events.contributions.models.persons.
SubContributionPersonLink
(*args, **kwargs)¶ Bases:
indico.modules.events.models.persons.PersonLinkBase
Association between EventPerson and SubContribution.
-
display_order
¶
-
id
¶
-
is_speaker
= True¶
-
object_relationship_name
= u'subcontribution'¶
-
person
¶
-
person_id
¶
-
person_link_backref_name
= u'subcontribution_links'¶
-
person_link_unique_columns
= (u'subcontribution_id',)¶
-
subcontribution_id
¶
-
-
class
indico.modules.events.contributions.models.principals.
ContributionPrincipal
(**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_registration_forms
= True¶
-
category_role
¶
-
category_role_id
¶
-
contribution_id
¶ The ID of the associated contribution
-
disallowed_protection_modes
= frozenset([])¶
-
email
¶
-
event_role
¶
-
event_role_id
¶
-
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
¶
-
permissions
¶
-
principal_backref_name
= u'in_contribution_acls'¶
-
principal_for
= u'Contribution'¶
-
read_access
¶
-
registration_form
¶
-
registration_form_id
¶
-
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, permission=None, **kwargs)¶
-
code
¶
-
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, include_groups=True)¶
-
id
¶
-
is_deleted
¶
-
is_protected
¶
-
location_parent
¶
-
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.
-
person_links
¶ 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.
-
abstracts_accepted
¶
-
description
¶
-
event
¶
-
event_id
¶
-
id
¶
-
is_private
¶
-
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
¶
-
proposed_abstracts
¶
-
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_boa_export_formats
()¶
-
indico.modules.events.contributions.util.
get_contribution_ical_file
(contrib)¶
-
indico.modules.events.contributions.util.
get_contributions_for_person
(event, person, only_speakers=False)¶ Get all contributions for an event person.
If
only_speakers
is true, then only contributions where the person is a speaker are returned
-
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)¶ Return 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.
import_contributions_from_csv
(event, f)¶ Import timetable contributions from a CSV file into an event.
-
indico.modules.events.contributions.util.
make_contribution_form
(event)¶ Extend 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.
render_archive
(event, contribs, sort_by, cls)¶
-
indico.modules.events.contributions.util.
render_pdf
(event, contribs, sort_by, cls)¶
-
indico.modules.events.contributions.util.
serialize_contribution_for_ical
(contrib)¶
-
indico.modules.events.contributions.util.
serialize_contribution_person_link
(person_link, is_submitter=None)¶ Serialize ContributionPersonLink to JSON-like object.
-
indico.modules.events.contributions.util.
sort_contribs
(contribs, sort_by)¶