Agreement

Todo

Docstrings (module, models, utilities)

Models

class indico.modules.events.agreements.models.agreements.Agreement(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Model

Agreements between a person and Indico.

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.

accept(from_ip, reason=None, on_behalf=False)
accepted
attachment

Attachment

attachment_filename

Filename and extension of the attachment

belongs_to(person)
static create_from_data(event, type_, person)
data

Definition-specific data of the agreement

definition
event

The Event this agreement is associated with

event_id

ID of the event

id

Entry ID

identifier

Unique identifier within the event and type

is_orphan()
locator
pending
person_email

Email of the person agreeing

person_name

Full name of the person agreeing

reason

Explanation as to why the agreement was accepted/rejected

reject(from_ip, reason=None, on_behalf=False)
rejected
render(form, **kwargs)
reset()
signed_dt

The date and time the agreement was signed

signed_from_ip

The IP from which the agreement was signed

signed_on_behalf
state

A AgreementState

timestamp

The date and time the agreement was created

type

Type of agreement

user

The user this agreement is linked to

user_id

ID of a linked user

uuid

Entry universally unique ID

class indico.modules.events.agreements.models.agreements.AgreementState

Bases: indico.util.struct.enum.RichIntEnum

accepted = 1
accepted_on_behalf = 3

agreement accepted on behalf of the person

pending = 0
rejected = 2
rejected_on_behalf = 4

agreement rejected on behalf of the person

Utilities

indico.modules.events.agreements.util.get_agreement_definitions()
indico.modules.events.agreements.util.send_new_agreements(event, name, people, email_body, cc_addresses, from_address)

Create and send agreements for a list of people on a given event.

Parameters:
  • event – The Event associated with the agreement
  • name – The agreement type matcing a AgreementDefinition name
  • people – The list of people for whom agreements will be created
  • email_body – The body of the email
  • cc_addresses – Email addresses to send CCs to
  • from_address – Email address of the sender

Placeholders

class indico.modules.events.agreements.placeholders.AgreementLinkPlaceholder

Bases: indico.util.placeholders.Placeholder

description = lu'Link to the agreement page'
name = u'agreement_link'
classmethod render(definition, agreement)
required = True
class indico.modules.events.agreements.placeholders.PersonNamePlaceholder

Bases: indico.util.placeholders.Placeholder

description = lu'Name of the person'
name = u'person_name'
classmethod render(definition, agreement)