Paper

Todo

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

Models

class indico.modules.events.papers.models.call_for_papers.CallForPapers(event)

Bases: object

Proxy class to facilitate access to the call for papers settings

announcement
assignees
can_access_judging_area(user)
can_access_reviewing_area(user)
close()
content_review_questions
content_reviewer_deadline
content_reviewers
content_reviewing_enabled
end_dt
get_questions_for_review_type(review_type)
get_reviewing_state(reviewing_type)
has_ended
has_started
is_judge(user)
is_manager(user)
is_open
is_reviewer(user, role=None)
is_staff(user)
judge_deadline
judges
layout_review_questions
layout_reviewer_deadline
layout_reviewers
layout_reviewing_enabled
managers
open()
rating_range
schedule(start_dt, end_dt)
set_reviewing_state(reviewing_type, enable)
start_dt
user_competences
class indico.modules.events.papers.models.comments.PaperReviewComment(**kwargs)

Bases: indico.modules.events.models.reviews.ProposalCommentMixin, indico.core.db.sqlalchemy.review_comments.ReviewCommentMixin, 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.

can_edit(user)
can_view(user)
created_dt
id
is_deleted
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.

modified_by
modified_by_id
modified_dt
paper_revision
render_mode = 2
revision_id
user
user_backref_name = u'review_comments'
user_id
user_modified_backref_name = u'modified_review_comments'
visibility
class indico.modules.events.papers.models.competences.PaperCompetence(**kwargs)

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

competences
event_id
event_new
id
user
user_id
class indico.modules.events.papers.models.files.PaperFile(*args, **kwargs)

Bases: indico.core.storage.models.StoredFileMixin, flask_sqlalchemy.Model

add_file_date_column = False
content_type

The MIME type of the file

created_dt = None
filename

The name of the file

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.

md5

An MD5 hash of the file.

Automatically assigned when save() is called.

paper
paper_revision
revision_id
size

The size of the file (in bytes).

Automatically assigned when save() is called.

storage_backend
storage_file_id
class indico.modules.events.papers.models.papers.Paper(contribution)

Bases: indico.modules.events.models.reviews.ProposalMixin

Proxy class to facilitate access to all paper-related properties

accepted_revision
call_for_proposals_attr = u'cfp'
can_comment(user, check_state=False)
can_judge(user, check_state=False)
can_manage(user)
can_review(user, check_state=False)
can_submit(user)
create_comment_endpoint = u'papers.submit_comment'
create_judgment_endpoint = u'papers.judge_paper'
create_review_endpoint = u'papers.submit_review'
delete_comment_endpoint = u'papers.delete_comment'
edit_comment_endpoint = u'papers.edit_comment'
edit_review_endpoint = u'papers.edit_review'
event_new
files
get_last_revision()
get_revisions()
is_in_final_state
judgment_comment
last_revision
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.

proposal_type = u'paper'
proxied_attr = u'contribution'
reset_state()
revision_count
revisions
revisions_enabled = True
state
title
verbose_title
class indico.modules.events.papers.models.review_questions.PaperReviewQuestion(**kwargs)

Bases: indico.core.db.sqlalchemy.review_questions.ReviewQuestionMixin, 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.

event_backref_name = u'paper_review_questions'
event_id
event_new
id
is_deleted
no_score
position
text
type
class indico.modules.events.papers.models.review_ratings.PaperReviewRating(**kwargs)

Bases: indico.core.db.sqlalchemy.review_ratings.ReviewRatingMixin, 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.

id
question
question_class

alias of PaperReviewQuestion

question_id
review
review_class

alias of PaperReview

review_id
value
class indico.modules.events.papers.models.reviews.PaperAction

Bases: indico.util.struct.enum.RichIntEnum

accept = 1
reject = 2
to_be_corrected = 3
class indico.modules.events.papers.models.reviews.PaperCommentVisibility

Bases: indico.util.struct.enum.RichIntEnum

Most to least restrictive visibility for paper comments

contributors = 3
judges = 1
reviewers = 2
users = 4
class indico.modules.events.papers.models.reviews.PaperJudgmentProxy(paper)

Bases: object

Represents a timeline item for the non final judgments

created_dt
timeline_item_type = u'judgment'
class indico.modules.events.papers.models.reviews.PaperReview(**kwargs)

Bases: indico.modules.events.models.reviews.ProposalReviewMixin, indico.core.db.sqlalchemy.descriptions.RenderModeMixin, flask_sqlalchemy.Model

Represents a paper review, emitted by a layout or content reviewer

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.

TIMELINE_TYPE = u'review'
can_edit(user, check_state=False)
can_view(user)
comment
created_dt
default_render_mode = 2
group_attr = u'type'
group_proxy_cls

alias of PaperTypeProxy

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.

modified_dt
possible_render_modes = set([<RenderMode.markdown: 2>])
proposed_action
render_mode = 2
revision
revision_attr = u'revision'
revision_id
score
type
user
user_id
visibility
class indico.modules.events.papers.models.reviews.PaperReviewType

Bases: indico.util.struct.enum.RichIntEnum

content = 2
layout = 1
class indico.modules.events.papers.models.reviews.PaperTypeProxy(group)

Bases: indico.modules.events.models.reviews.ProposalGroupProxy

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.

class indico.modules.events.papers.models.revisions.PaperRevision(*args, **kwargs)

Bases: indico.modules.events.models.reviews.ProposalRevisionMixin, indico.core.db.sqlalchemy.descriptions.RenderModeMixin, flask_sqlalchemy.Model

default_render_mode = 2
get_reviewed_for_groups(user, include_reviewed=False)
get_reviews(group=None, user=None)
get_spotlight_file()
get_timeline(user=None)
has_user_reviewed(user, review_type=None)
id
is_last_revision
judge
judge_id
judgment_comment
judgment_dt
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.

number
paper
possible_render_modes = set([<RenderMode.markdown: 2>])
proposal_attr = u'paper'
render_mode = 2
state
submitted_dt
submitter
submitter_id
class indico.modules.events.papers.models.revisions.PaperRevisionState

Bases: indico.util.struct.enum.RichIntEnum

accepted = 2
rejected = 3
submitted = 1
to_be_corrected = 4
class indico.modules.events.papers.models.templates.PaperTemplate(**kwargs)

Bases: indico.core.storage.models.StoredFileMixin, 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.

add_file_date_column = False
content_type

The MIME type of the file

created_dt = None
description
event_id
event_new
filename

The name of the file

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.

md5

An MD5 hash of the file.

Automatically assigned when save() is called.

name
size

The size of the file (in bytes).

Automatically assigned when save() is called.

storage_backend
storage_file_id

Operations

indico.modules.events.papers.operations.close_cfp(event)
indico.modules.events.papers.operations.create_comment(*args, **kwargs)
indico.modules.events.papers.operations.create_competences(event, user, competences)
indico.modules.events.papers.operations.create_paper_revision(paper, submitter, files)
indico.modules.events.papers.operations.create_paper_template(event, data)
indico.modules.events.papers.operations.create_review(paper, review_type, user, review_data, questions_data)
indico.modules.events.papers.operations.delete_comment(comment)
indico.modules.events.papers.operations.delete_paper_template(template)
indico.modules.events.papers.operations.judge_paper(*args, **kwargs)
indico.modules.events.papers.operations.open_cfp(event)
indico.modules.events.papers.operations.reset_paper_state(paper)
indico.modules.events.papers.operations.schedule_cfp(event, start_dt, end_dt)
indico.modules.events.papers.operations.set_deadline(event, role, deadline, enforce=True)
indico.modules.events.papers.operations.set_reviewing_state(event, reviewing_type, enable)
indico.modules.events.papers.operations.update_comment(comment, text, visibility)
indico.modules.events.papers.operations.update_competences(user_competences, competences)
indico.modules.events.papers.operations.update_paper_template(template, data)
indico.modules.events.papers.operations.update_review(review, review_data, questions_data)
indico.modules.events.papers.operations.update_reviewing_roles(event, users, contributions, role, assign)
indico.modules.events.papers.operations.update_team_members(event, managers, judges, content_reviewers=None, layout_reviewers=None)

Utilities

indico.modules.events.papers.util.get_contributions_with_paper_submitted_by_user(event, user)
indico.modules.events.papers.util.get_contributions_with_user_paper_submission_rights(event, user)
indico.modules.events.papers.util.get_events_with_paper_roles(user, dt=None)

Get the IDs and PR roles of events where the user has any kind of paper reviewing privileges.

Parameters:
  • user – A User
  • dt – Only include events taking place on/after that date
Returns:

A dict mapping event IDs to a set of roles

indico.modules.events.papers.util.get_user_contributions_to_review(event, user)

Get the list of contributions where user has paper to review

indico.modules.events.papers.util.get_user_reviewed_contributions(event, user)

Get the list of contributions where user already reviewed paper

indico.modules.events.papers.util.has_contributions_with_user_paper_submission_rights(event, user)

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)

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

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

Replaces all ACL user entries for source with target

remove_principal(event, *args, **kwargs)

Removes a principal from an ACL

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

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

Deletes settings.

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

Deletes all settings.

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

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

Retrieves all settings

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

Dict containing the settings

query

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

set(event, *args, **kwargs)

Sets a single setting.

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

Sets 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(*args, **kwargs)
settings
themes
indico.modules.events.settings.event_or_id(f)