Agreement¶
Todo
Docstrings (module, models, utilities)
Models¶
-
class
indico.modules.events.agreements.models.agreements.
Agreement
(**kwargs)¶ Bases:
sqlalchemy.orm.decl_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
¶
-
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
-
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
= l'Link to the agreement page'¶
-
name
= 'agreement_link'¶
-
classmethod
render
(definition, agreement)¶ Convert the placeholder to a string.
When a placeholder contains HTML that should not be escaped, the returned value should be returned as a
markupsafe.Markup
instance instead of a plain string.Subclasses are encouraged to explicitly specify the arguments they expect instead of using
**kwargs
.Parameters: kwargs – arguments specific to the placeholder’s context
-
required
= True¶
-
-
class
indico.modules.events.agreements.placeholders.
PersonNamePlaceholder
¶ Bases:
indico.util.placeholders.Placeholder
-
description
= l'Name of the person'¶
-
name
= 'person_name'¶
-
classmethod
render
(definition, agreement)¶ Convert the placeholder to a string.
When a placeholder contains HTML that should not be escaped, the returned value should be returned as a
markupsafe.Markup
instance instead of a plain string.Subclasses are encouraged to explicitly specify the arguments they expect instead of using
**kwargs
.Parameters: kwargs – arguments specific to the placeholder’s context
-