Data models

The following are all of the relevant pretalx database models, including their interfaces. All non-documented methods and properties should be considered private and unstable. All methods and properties documented here may change between releases, but any change will be mentioned in the release notes starting with the 1.0 release.

All event related objects have an event property. It always returns the event this object belongs to, to ease permission checks and reduce the need for duplicate lookups.

Events and organisers

class pretalx.event.models.event.Event(*args, **kwargs)[source]

The Event class has direct or indirect relations to all other models.

Since most models depend on the Event model in some way, they should preferably be accessed via the reverse relation on the event model to prevent data leaks.

Parameters:
  • is_public – Is this event public yet? Should only be set via the pretalx.orga.views.EventLive view or in another way that processes the pretalx.orga.signals.activate_event signal.

  • locale_array – Contains the event’s active locales as a comma separated string. Please use the locales property to interact with this information.

  • content_locale_array – Contains the event’s active locales available for proposals as a comma separated string. Please use the content_locales property to interact with this information.

  • accept_template – Templates for emails sent when accepting a talk.

  • reject_template – Templates for emails sent when rejecting a talk.

  • ack_template – Templates for emails sent when acknowledging that a submission was sent in.

  • update_template – Templates for emails sent when a talk scheduling was modified.

  • question_template – Templates for emails sent when a speaker has not yet answered a question, and organisers send out reminders.

  • primary_color – Main event colour. Accepts hex values like #00ff00.

  • custom_css – Custom event CSS. Has to pass fairly restrictive validation for security considerations.

  • custom_domain – Custom event domain, starting with https://.

  • plugins – A list of active plugins as a comma-separated string. Please use the plugin_list property for interaction.

  • feature_flags – A JSON field containing feature flags for this event. Please use the get_feature_flag method to check for features, so that new feature flags can be added without breaking existing events.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • name (I18nCharField) – Name

  • slug (SlugField) – Short form. The slug may only contain letters, numbers, dots and dashes.

  • date_from (DateField) – Event start date

  • date_to (DateField) – Event end date

  • timezone (CharField) – Timezone. All event dates will be localised and interpreted to be in this timezone.

  • email (EmailField) – Organiser email address. Will be used as Reply-To in emails.

  • display_settings (JSONField) – Display settings

  • review_settings (JSONField) – Review settings

  • mail_settings (JSONField) – Mail settings

  • logo (ImageField) – Logo. If you provide a logo image, your event’s name will not be shown in the event header. The logo will be scaled down to a height of 150px.

  • header_image (ImageField) – Header image. If you provide a header image, it will be displayed instead of your event’s color and/or header pattern at the top of all event pages. It will be center-aligned, so when the window shrinks, the center parts will continue to be displayed, and not stretched.

  • locale (CharField) – Default language

  • landing_page_text (I18nTextField) – Landing page text. This text will be shown on the landing page, alongside with links to the CfP and schedule, if appropriate. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.

  • featured_sessions_text (I18nTextField) – Featured sessions text. This text will be shown at the top of the featured sessions page instead of the default text. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.

Relationship fields:

Parameters:

organiser (ForeignKey to Organiser) – Organiser (related name: events)

Reverse relationships:

Parameters:
  • log_entries (Reverse ForeignKey from ActivityLog) – All log entries of this event (related name of event)

  • _settings_objects (Reverse ForeignKey from Event_SettingsStore) – All settings objects of this event (related name of object)

  • team (Reverse ManyToManyField from Team) – All teams of this event (related name of limit_events)

  • mail_templates (Reverse ForeignKey from MailTemplate) – All mail templates of this event (related name of event)

  • queued_mails (Reverse ForeignKey from QueuedMail) – All queued mails of this event (related name of event)

  • information (Reverse ForeignKey from SpeakerInformation) – All information of this event (related name of event)

  • availabilities (Reverse ForeignKey from Availability) – All availabilities of this event (related name of event)

  • rooms (Reverse ForeignKey from Room) – All rooms of this event (related name of event)

  • schedules (Reverse ForeignKey from Schedule) – All schedules of this event (related name of event)

  • submitter_access_codes (Reverse ForeignKey from SubmitterAccessCode) – All submitter access codes of this event (related name of event)

  • cfp (Reverse OneToOneField from CfP) – The cf p of this event (related name of event)

  • questions (Reverse ForeignKey from Question) – All questions of this event (related name of event)

  • score_categories (Reverse ForeignKey from ReviewScoreCategory) – All score categories of this event (related name of event)

  • review_phases (Reverse ForeignKey from ReviewPhase) – All review phases of this event (related name of event)

  • submissions (Reverse ForeignKey from Submission) – All submissions of this event (related name of event)

  • tags (Reverse ForeignKey from Tag) – All tags of this event (related name of event)

  • tracks (Reverse ForeignKey from Track) – All tracks of this event (related name of event)

  • submission_types (Reverse ForeignKey from SubmissionType) – All submission types of this event (related name of event)

disable_plugin(module)[source]

Disables a plugin. If the given plugin is in the list of active plugins, it will be removed and uninstall() will be called.

Return type:

None

enable_plugin(module)[source]

Enables a plugin. If the given plugin is available and was not in the list of active plugins, it will be added and installed() will be called.

Return type:

None

get_date_range_display()[source]

Returns the localised, prettily formatted date range for this event.

E.g. as long as the event takes place within the same month, the month is only named once.

Return type:

str

release_schedule(name, user=None, notify_speakers=False, comment=None)[source]

Releases a new Schedule by finalising the current WIP schedule.

Parameters:
  • name (str) – The new version name

  • user (User) – The User executing the release

  • notify_speakers (bool) – Generate emails for all speakers with changed slots.

  • comment (str) – Public comment for the release

shred(person=None)[source]

Irrevocably deletes an event and all related data.

cache

Returns an ObjectRelatedCache object.

This behaves equivalent to Django’s built-in cache backends, but puts you into an isolated environment for this event, so you don’t have to prefix your cache keys.

current_schedule

Returns the latest released.

Schedule, or None before the first release.

datetime_from

The localised datetime of the event start date.

Return type:

datetime

datetime_to

The localised datetime of the event end date.

Return type:

datetime

is_multilingual

Is True if the event supports more than one locale.

locales

Is a list of active event locales.

named_locales

Is a list of tuples of locale codes and natural names for this event.

pending_mails

The amount of currently unsent.

QueuedMail objects.

speakers

Returns a queryset of all speakers (of type.

User) visible in the current released schedule.

submitters

Returns a queryset of all User objects who have submitted to this event.

Ignores users who have deleted all of their submissions.

talks

Returns a queryset of all.

Submission object in the current released schedule.

teams

Returns all Team objects that concern this event.

wip_schedule

Returns the latest unreleased.

Schedule.

Retval:

Schedule

class pretalx.event.models.organiser.Organiser(*args, **kwargs)[source]

The Organiser model represents the entity responsible for at least one.

Event.

Parameters:
  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • name (I18nCharField) – Name

  • slug (SlugField) – Short form. Should be short, only contain lowercase letters and numbers, and must be unique, as it is used in URLs.

Reverse relationships:

Parameters:
  • events (Reverse ForeignKey from Event) – All events of this organiser (related name of organiser)

  • teams (Reverse ForeignKey from Team) – All teams of this organiser (related name of organiser)

shred(person=None)[source]

Irrevocably deletes the organiser and all related events and their data.

class pretalx.event.models.organiser.Team(*args, **kwargs)[source]

A team is a group of people working for the same organiser.

Team members (of type User) share permissions for one or several events of Organiser. People can be in multiple Teams, and will have all permissions any of their teams has.

Parameters:
  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • name (CharField) – Team name

  • all_events (BooleanField) – Apply permissions to all events by this organiser (including newly created ones)

  • can_create_events (BooleanField) – Can create events

  • can_change_teams (BooleanField) – Can change teams and permissions

  • can_change_organiser_settings (BooleanField) – Can change organiser settings

  • can_change_event_settings (BooleanField) – Can change event settings

  • can_change_submissions (BooleanField) – Can work with and change proposals

  • is_reviewer (BooleanField) – Is a reviewer

  • force_hide_speaker_names (BooleanField) – Always hide speaker names. Normally, anonymisation is configured in the event review settings. This setting will <b>override the event settings</b> and always hide speaker names for this team.

Relationship fields:

Parameters:

Reverse relationships:

Parameters:

invites (Reverse ForeignKey from TeamInvite) – All invites of this team (related name of team)

permission_set

A set of all permissions this team has, as strings.

class pretalx.submission.models.cfp.CfP(*args, **kwargs)[source]

Every Event has one Call for Papers/Participation/Proposals.

Parameters:
  • deadline – The regular deadline. Please note that submissions can be available for longer than this if different deadlines are configured on single submission types.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • headline (I18nCharField) – Headline

  • text (I18nTextField) – Text. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.

  • settings (JSONField) – Settings

  • fields (JSONField) – Fields

Relationship fields:

Parameters:
is_open

True if max_deadline is not over yet, or if no deadline is set.

max_deadline

Returns the latest date any submission is possible.

This includes the deadlines set on any submission type for this event.

class pretalx.submission.models.review.ReviewPhase(*args, **kwargs)[source]

ReviewPhases determine reviewer access rights during a (potentially open) time frame.

Parameters:
  • is_active – Is this phase currently active? There can be only one active phase per event. Use the activate method to activate a review phase, as it will take care of this limitation.

  • position – Helper field to deal with relative positioning of review phases next to each other.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • name (CharField) – Name

  • start (DateTimeField) – Phase start

  • end (DateTimeField) – Phase end

  • can_review (BooleanField) – Reviewers can write and edit reviews

  • proposal_visibility (CharField) – Reviewers may see these proposals. If you select “all”, reviewers can review all proposals that their teams have access to (so either all, or specific tracks). In this mode, assigned proposals will be highlighted and will be shown first in the review workflow.

  • can_see_other_reviews (CharField) – Reviewers can see other reviews

  • can_see_speaker_names (BooleanField) – Reviewers can see speaker names

  • can_see_reviewer_names (BooleanField) – Reviewers can see the names of other reviewers

  • can_change_submission_state (BooleanField) – Reviewers can accept and reject proposals

  • can_tag_submissions (CharField) – Reviewers can tag proposals

  • speakers_can_change_submissions (BooleanField) – Speakers can modify their proposals before acceptance. By default, modification of proposals is locked after the CfP ends, and is re-enabled once the proposal was accepted.

Relationship fields:

Parameters:

event (ForeignKey to Event) – Event (related name: review_phases)

activate()[source]

Activates this review phase and deactivates all others in this event.

Return type:

None

Users and profiles

class pretalx.person.models.user.User(*args, **kwargs)[source]

The pretalx user model.

Users describe all kinds of persons who interact with pretalx: Organisers, reviewers, submitters, speakers.

Parameters:
  • code – A user’s alphanumeric code is auto generated, may not be changed, and is the unique identifier of that user.

  • name – A name fit for public display. Will be used in the user interface and for public display for all speakers in all of their events.

  • password – The password is stored using Django’s PasswordField. Use the set_password and check_password methods to interact with it.

  • nick – The nickname field has been deprecated and is scheduled to be deleted. Use the email field instead.

  • groups – Django internals, not used in pretalx.

  • user_permissions – Django internals, not used in pretalx.

  • id (AutoField) – Primary key: ID

  • last_login (DateTimeField) – Last login

  • email (EmailField) – Email. Your email address will be used for password resets and notification about your event/proposals.

  • is_active (BooleanField) – Is active. Inactive users are not allowed to log in.

  • is_staff (BooleanField) – Is staff. A default Django flag. Not in use in pretalx.

  • is_administrator (BooleanField) – Is administrator. Should only be True for people with administrative access to the server pretalx runs on.

  • is_superuser (BooleanField) – Is superuser. Never set this flag to True, since it short-circuits all authorisation mechanisms.

  • locale (CharField) – Preferred language

  • timezone (CharField) – Timezone

  • avatar (ImageField) – Profile picture. We recommend uploading an image at least 400px wide. A square image works best, as we display it in a circle in several places.

  • avatar_thumbnail (ImageField) – Avatar thumbnail

  • avatar_thumbnail_tiny (ImageField) – Avatar thumbnail tiny

  • get_gravatar (BooleanField) – Retrieve profile picture via gravatar. If you have registered with an email address that has a gravatar account, we can retrieve your profile picture from there.

  • pw_reset_token (CharField) – Password reset token

  • pw_reset_time (DateTimeField) – Password reset time

Reverse relationships:

Parameters:
  • auth_token (Reverse OneToOneField from Token) – The auth token of this user (related name of user)

  • log_entries (Reverse ForeignKey from ActivityLog) – All log entries of this user (related name of person)

  • teams (Reverse ManyToManyField from Team) – All teams of this user (related name of members)

  • mails (Reverse ManyToManyField from QueuedMail) – All mails of this user (related name of to_users)

  • profiles (Reverse ForeignKey from SpeakerProfile) – All profiles of this user (related name of user)

  • feedback (Reverse ForeignKey from Feedback) – All feedback of this user (related name of speaker)

  • answers (Reverse ForeignKey from Answer) – All answers of this user (related name of person)

  • reviews (Reverse ForeignKey from Review) – All reviews of this user (related name of user)

  • submissions (Reverse ManyToManyField from Submission) – All submissions of this user (related name of speakers)

  • assigned_reviews (Reverse ManyToManyField from Submission) – All assigned reviews of this user (related name of assigned_reviewers)

  • submission_favourites (Reverse ForeignKey from SubmissionFavourite) – All submission favourites of this user (related name of user)

event_profile(event)[source]

Retrieve (and/or create) the event.

SpeakerProfile for this user.

Retval:

pretalx.person.models.profile.EventProfile

get_display_name()[source]

Returns a user’s name or ‘Unnamed user’.

Return type:

str

get_events_for_permission(**kwargs)[source]

Returns a queryset of events for which this user as all of the given permissions.

Permissions are given as named arguments, e.g. get_events_for_permission(is_reviewer=True).

get_events_with_any_permission()[source]

Returns a queryset of events for which this user has any type of permission.

get_permissions_for_event(event)[source]

Returns a set of all permission a user has for the given event.

Return type:

set

log_action(action, data=None, person=None, orga=False)[source]

Create a log entry for this user.

Parameters:
  • action (str) – The log action that took place.

  • data (dict) – Addition data to be saved.

  • person (User) – The person modifying this user. Defaults to this user.

  • orga (bool) – Was this action initiated by a privileged user?

class pretalx.person.models.profile.SpeakerProfile(*args, **kwargs)[source]

All Event related data concerning a.

User is stored here.

Parameters:

Relationship fields:

Parameters:

Reverse relationships:

Parameters:

availabilities (Reverse ForeignKey from Availability) – All availabilities of this speaker profile (related name of person)

answers

A queryset of Answer objects.

Includes all answers the user has given either for themselves or for their talks for this event.

submissions

All non-deleted.

Submission objects by this user on this event.

talks

A queryset of.

Submission objects.

Contains all visible talks by this user on this event.

class pretalx.person.models.information.SpeakerInformation(*args, **kwargs)[source]

Represents any information organisers want to show all or some submitters or speakers.

Parameters:

Relationship fields:

Parameters:
  • event (ForeignKey to Event) – Event (related name: information)

  • limit_tracks (ManyToManyField to Track) – Limit to tracks. Leave empty to show this information to all tracks. (related name: speakerinformation)

  • limit_types (ManyToManyField to SubmissionType) – Limit to proposal types. Leave empty to show this information for all proposal types. (related name: speakerinformation)

Submissions

Submissions are the most central model to pretalx, and everything else is connected to submissions.

class pretalx.submission.models.submission.Submission(*args, **kwargs)[source]

Submissions are, next to Event, the central model in pretalx.

A submission, which belongs to exactly one event, can have multiple speakers and a lot of other related data, such as a SubmissionType, a Track, multiple Answer objects, and so on.

Parameters:
  • code – The unique alphanumeric identifier used to refer to a submission.

  • state – The submission can be ‘submitted’, ‘accepted’, ‘confirmed’, ‘rejected’, ‘withdrawn’, or ‘canceled’. State changes should be done via the corresponding methods, like accept(). The SubmissionStates class comes with a method_names dictionary for method lookup.

  • image – An image illustrating the talk or topic.

  • review_code – A token used in secret URLs giving read-access to the submission.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • title (CharField) – Proposal title

  • pending_state (CharField) – Pending proposal state

  • abstract (TextField) – Abstract. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.

  • description (TextField) – Description. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.

  • notes (TextField) – Notes. These notes are meant for the organiser and won’t be made public.

  • internal_notes (TextField) – Internal notes. Internal notes for other organisers/reviewers. Not visible to the speakers or the public.

  • duration (PositiveIntegerField) – Duration. The duration in minutes.

  • slot_count (IntegerField) – Slot Count. How many times this session will take place.

  • content_locale (CharField) – Language

  • is_featured (BooleanField) – Show this session in public list of featured sessions.

  • do_not_record (BooleanField) – Don’t record this session.

  • invitation_token (CharField) – Invitation token

  • anonymised_data (TextField) – Anonymised data

Relationship fields:

Parameters:

Reverse relationships:

Parameters:
  • mails (Reverse ManyToManyField from QueuedMail) – All mails of this submission (related name of submissions)

  • slots (Reverse ForeignKey from TalkSlot) – All slots of this submission (related name of submission)

  • feedback (Reverse ForeignKey from Feedback) – All feedback of this submission (related name of talk)

  • answers (Reverse ForeignKey from Answer) – All answers of this submission (related name of submission)

  • resources (Reverse ForeignKey from Resource) – All resources of this submission (related name of submission)

  • reviews (Reverse ForeignKey from Review) – All reviews of this submission (related name of submission)

  • favourites (Reverse ForeignKey from SubmissionFavourite) – All favourites of this submission (related name of submission)

accept(person=None, force=False, orga=True, from_pending=False)[source]

Sets the submission’s state to ‘accepted’.

Creates an acceptance QueuedMail unless the submission was previously confirmed.

cancel(person=None, force=False, orga=True, from_pending=False)[source]

Sets the submission’s state to ‘canceled’.

confirm(person=None, force=False, orga=False, from_pending=False)[source]

Sets the submission’s state to ‘confirmed’.

get_duration()[source]

Returns this submission’s duration in minutes.

Falls back to the SubmissionType’s default duration if none is set on the submission.

Return type:

int

make_submitted(person=None, force=False, orga=False, from_pending=False)[source]

Sets the submission’s state to ‘submitted’.

reject(person=None, force=False, orga=True, from_pending=False)[source]

Sets the submission’s state to ‘rejected’ and creates a rejection.

QueuedMail.

update_duration()[source]

Apply the submission’s duration to its currently scheduled.

TalkSlot.

Should be called whenever the duration changes.

update_talk_slots()[source]

Makes sure the correct amount of.

TalkSlot objects exists.

After an update or state change, talk slots should either be all deleted, or all created, or the number of talk slots might need to be adjusted.

withdraw(person=None, force=False, orga=False, from_pending=False)[source]

Sets the submission’s state to ‘withdrawn’.

property availabilities

The intersection of all.

Availability objects of all speakers of this submission.

display_speaker_names

Helper method for a consistent speaker name display.

public_slots

All publicly visible TalkSlot objects of this submission in the current.

Schedule.

slot

The first scheduled TalkSlot of this submission in the current.

Schedule.

Note that this slot is not guaranteed to be visible.

class pretalx.submission.models.review.Review(*args, **kwargs)[source]

Reviews model the opinion of reviewers of a.

Submission.

They can, but don’t have to, include a score and a text.

Parameters:
  • text – The review itself. May be empty.

  • score – This score is calculated from all the related scores and their weights. Do not set it directly, use the update_score method instead.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

Relationship fields:

Parameters:

Reverse relationships:

Parameters:

answers (Reverse ForeignKey from Answer) – All answers of this review (related name of review)

classmethod find_missing_reviews(event, user, ignore=None)[source]

Returns all Submission objects this User still has to review for the given Event. A subset of find_reviewable_submissions.

Return type:

Queryset of Submission objects

display_score

Helper method to get a display string of the review’s score.

class pretalx.submission.models.feedback.Feedback(*args, **kwargs)[source]

The Feedback model allows for anonymous feedback by attendees to one or all speakers of a.

Submission.

Parameters:

Relationship fields:

Parameters:

talk (ForeignKey to Submission) – Session (related name: feedback)

class pretalx.submission.models.track.Track(*args, **kwargs)[source]

A track groups Submission objects within an Event, e.g. by topic.

Parameters:
  • color – The track colour, in the format #012345.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • name (I18nCharField) – Name

  • description (I18nTextField) – Description

  • position (PositiveIntegerField) – Position

  • requires_access_code (BooleanField) – Requires access code. This track will only be shown to submitters with a matching access code.

Relationship fields:

Parameters:

event (ForeignKey to Event) – Event (related name: tracks)

Reverse relationships:

Parameters:
  • team (Reverse ManyToManyField from Team) – All teams of this track (related name of limit_tracks)

  • speakerinformation (Reverse ManyToManyField from SpeakerInformation) – All speaker informations of this track (related name of limit_tracks)

  • submitter_access_codes (Reverse ForeignKey from SubmitterAccessCode) – All submitter access codes of this track (related name of track)

  • questions (Reverse ManyToManyField from Question) – All questions of this track (related name of tracks)

  • reviewscorecategory (Reverse ManyToManyField from ReviewScoreCategory) – All review score categorys of this track (related name of limit_tracks)

  • submissions (Reverse ForeignKey from Submission) – All submissions of this track (related name of track)

property slug: str

The slug makes tracks more readable in URLs.

It consists of the ID, followed by a slugified (and, in lookups, optional) form of the track name.

class pretalx.submission.models.type.SubmissionType(*args, **kwargs)[source]

Each Submission has one SubmissionType.

SubmissionTypes are used to group submissions by default duration (which can be overridden on a per-submission basis), and to be able to offer different deadlines for some parts of the Event.

Parameters:
  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • name (I18nCharField) – Name

  • default_duration (PositiveIntegerField) – Default duration. Default duration in minutes

  • deadline (DateTimeField) – Deadline. If you want a different deadline than the global deadline for this session type, enter it here.

  • requires_access_code (BooleanField) – Requires access code. This session type will only be shown to submitters with a matching access code.

Relationship fields:

Parameters:

event (ForeignKey to Event) – Event (related name: submission_types)

Reverse relationships:

Parameters:
  • speakerinformation (Reverse ManyToManyField from SpeakerInformation) – All speaker informations of this submission type (related name of limit_types)

  • submitter_access_codes (Reverse ForeignKey from SubmitterAccessCode) – All submitter access codes of this submission type (related name of submission_type)

  • questions (Reverse ManyToManyField from Question) – All questions of this submission type (related name of submission_types)

  • submissions (Reverse ForeignKey from Submission) – All submissions of this submission type (related name of submission_type)

update_duration()[source]

Updates the duration of all.

TalkSlot objects of Submission objects of this type.

Runs only for submissions that do not override their default duration. Should be called whenever duration changes.

property slug: str

The slug makes tracks more readable in URLs.

It consists of the ID, followed by a slugified (and, in lookups, optional) form of the submission type name.

class pretalx.submission.models.resource.Resource(*args, **kwargs)[source]

Resources are file uploads belonging to a Submission.

Parameters:

Relationship fields:

Parameters:

submission (ForeignKey to Submission) – Submission (related name: resources)

Questions and answers

class pretalx.submission.models.question.Question(*args, **kwargs)[source]

Questions can be asked per.

Submission, per speaker, or of reviewers per Review.

Questions can have many types, which offers a flexible framework to give organisers the opportunity to get all the information they need.

Parameters:
  • variant – Can be any of ‘number’, ‘string’, ‘text’, ‘boolean’, ‘file’, ‘choices’, or ‘multiple_choice’. Defined in the QuestionVariant class.

  • target – Can be any of ‘submission’, ‘speaker’, or ‘reviewer’. Defined in the QuestionTarget class.

  • deadline – Datetime field. This field is required for ‘after deadline’ and ‘freeze after’ options of question_required field and optional for the other ones. For ‘after deadline’ it shows that the answer will be optional before the deadline and mandatory after that deadline. For ‘freeze after’ it shows that the answer will be allowed before the deadline and frozen after that deadline

  • question_required – Can be any of ‘none’, ‘require ‘, ‘after deadline’, or ‘freeze after’. Defined in the QuestionRequired class. ‘required’ answering this question will always be required. ‘optional’ means that it will never be mandatory. ‘after deadline’ the answer will be optional before the deadline and mandatory after the deadline.

  • freeze_after – Can be a datetime field or null. For ‘freeze after’ the answer will be allowed before the deadline and frozen after the deadline.

  • position – Position in the question order in this event.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • question (I18nCharField) – Question

  • help_text (I18nCharField) – Help text. Will appear just like this text below the question input field. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.

  • default_answer (TextField) – Default answer

  • active (BooleanField) – Active. Inactive questions will no longer be asked.

  • contains_personal_data (BooleanField) – Answers contain personal data. If a user deletes their account, answers of questions for personal data will be removed, too.

  • min_length (PositiveIntegerField) – Minimum text length. Minimum allowed text in characters or words (set in CfP settings).

  • max_length (PositiveIntegerField) – Maximum text length. Maximum allowed text length in characters or words (set in CfP settings).

  • min_number (DecimalField) – Minimum value

  • max_number (DecimalField) – Maximum value

  • min_date (DateField) – Minimum value

  • max_date (DateField) – Maximum value

  • min_datetime (DateTimeField) – Minimum value

  • max_datetime (DateTimeField) – Maximum value

  • is_public (BooleanField) – Publish answers. Answers will be shown on session or speaker pages as appropriate. Please note that you cannot make a question public after the first answers have been given, to allow speakers explicit consent before publishing information.

  • is_visible_to_reviewers (BooleanField) – Show answers to reviewers. Should answers to this question be shown to reviewers? This is helpful if you want to collect personal information, but use anonymous reviews.

Relationship fields:

Parameters:
  • event (ForeignKey to Event) – Event (related name: questions)

  • tracks (ManyToManyField to Track) – Tracks. You can limit this question to some tracks. Leave this field empty to apply to all tracks. (related name: questions)

  • submission_types (ManyToManyField to SubmissionType) – Session Types. You can limit this question to some session types. Leave this field empty to apply to all session types. (related name: questions)

Reverse relationships:

Parameters:
  • options (Reverse ForeignKey from AnswerOption) – All options of this question (related name of question)

  • answers (Reverse ForeignKey from Answer) – All answers of this question (related name of question)

missing_answers(filter_speakers=False, filter_talks=False)[source]

Returns how many answers are still missing or this question.

This method only supports submission questions and speaker questions. For missing reviews, please use the Review.find_missing_reviews method.

Parameters:
  • filter_speakers (list) – Apply only to these speakers.

  • filter_talks (list) – Apply only to these talks.

Return type:

int

class pretalx.submission.models.question.AnswerOption(*args, **kwargs)[source]

Provides the possible answers for.

Question objects of variant ‘choice’ or ‘multiple_choice’.

Parameters:

Relationship fields:

Parameters:

question (ForeignKey to Question) – Question (related name: options)

Reverse relationships:

Parameters:

answers (Reverse ManyToManyField from Answer) – All answers of this answer option (related name of options)

class pretalx.submission.models.question.Answer(*args, **kwargs)[source]

Answers are connected to a.

Question, and, depending on type, a User, a Submission, or a Review.

Parameters:

Relationship fields:

Parameters:
remove(person=None, force=False)[source]

Deletes an answer.

Schedules and talk slots

class pretalx.schedule.models.schedule.Schedule(*args, **kwargs)[source]

The Schedule model contains all scheduled.

TalkSlot objects (visible or not) for a schedule release for an Event.

Parameters:
  • publishedNone if the schedule has not been published yet.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • version (CharField) – Version

  • comment (I18nTextField) – Comment. This text will be shown in the public changelog and the RSS feed. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.

Relationship fields:

Parameters:

event (ForeignKey to Event) – Event (related name: schedules)

Reverse relationships:

Parameters:

talks (Reverse ForeignKey from TalkSlot) – All talks of this schedule (related name of schedule)

freeze(name, user=None, notify_speakers=True, comment=None)[source]

Releases the current WIP schedule as a fixed schedule version.

Parameters:
  • name (str) – The new schedule name. May not be in use in this event, and cannot be ‘wip’ or ‘latest’.

  • user – The User initiating the freeze.

  • notify_speakers (bool) – Should notification emails for speakers with changed slots be generated?

  • comment (str) – Public comment for the release

Return type:

Schedule

unfreeze(user=None)[source]

Resets the current WIP schedule to an older schedule version.

changes

Returns a dictionary of changes when compared to the previous version.

The action field is either create or update. If it’s an update, the count integer, and the new_talks, canceled_talks and moved_talks lists are also present.

previous_schedule

Returns the schedule released before this one, if any.

scheduled_talks

Returns all TalkSlot objects that have been scheduled and are visible in the schedule (that is, have been confirmed at the time of release).

slots

Returns all.

Submission objects with TalkSlot objects in this schedule.

speakers_concerned

Returns a dictionary of speakers with their new and changed talks in this schedule.

Each speaker is assigned a dictionary with create and update fields, each containing a list of submissions.

warnings

A dictionary of warnings to be acknowledged before a release.

talk_warnings contains a list of talk-related warnings. unscheduled is the list of talks without a scheduled slot, unconfirmed is the list of submissions that will not be visible due to their unconfirmed status, and no_track are submissions without a track in a conference that uses tracks.

class pretalx.schedule.models.slot.TalkSlot(*args, **kwargs)[source]

The TalkSlot object is the scheduled version of a.

Submission.

TalkSlots always belong to one submission and one Schedule.

Parameters:
  • is_visible – This parameter is set on schedule release. Only confirmed talks will be visible.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • start (DateTimeField) – Start. When the talk starts, if it is currently scheduled

  • end (DateTimeField) – End. When the talk ends, if it is currently scheduled

  • description (I18nCharField) – Description

Relationship fields:

Parameters:
copy_to_schedule(new_schedule, save=True)[source]

Create a new slot for the given.

Schedule with all other fields identical to this one.

is_same_slot(other_slot)[source]

Checks if both slots have the same room and start time.

Return type:

bool

as_availability

‘Casts’ a slot as.

Availability, useful for availability arithmetic.

property duration: int

Returns the actual duration in minutes if the talk is scheduled, and the planned duration in minutes otherwise.

real_end

Guaranteed to provide a useful end datetime if start is set, even if end is empty.

class pretalx.schedule.models.availability.Availability(*args, **kwargs)[source]

The Availability class models when people or rooms are available for.

TalkSlot objects.

The power of this class is not within its rather simple data model, but with the operations available on it. An availability object can span multiple days, but due to our choice of input widget, it will usually only span a single day at most.

Parameters:

Relationship fields:

Parameters:
__and__(other)[source]

Performs the intersect operation: availability1 & availability2

Return type:

Availability

__eq__(other)[source]

Comparisons like availability1 == availability2.

Checks if event, person, room, start and end are the same.

Return type:

bool

__or__(other)[source]

Performs the merge operation: availability1 | availability2

Return type:

Availability

contains(other)[source]

Tests if this availability starts before and ends after the other.

Return type:

bool

intersect_with(other)[source]

Return a new Availability which spans the range covered both by this one and the given one.

Return type:

Availability

classmethod intersection(*availabilitysets)[source]

Return the list of Availabilities which are covered by all of the given sets.

Return type:

list[Availability]

merge_with(other)[source]

Return a new Availability which spans the range of this one and the given one.

Return type:

Availability

overlaps(other, strict)[source]

Test if two Availabilities overlap.

Parameters:

strict (bool) – Only count a real overlap as overlap, not direct adjacency.

Return type:

bool

classmethod union(availabilities)[source]

Return the minimal list of Availability objects which are covered by at least one given Availability.

Return type:

list[Availability]

all_day

Checks if the Availability spans one (or, technically: multiple) complete day.

class pretalx.schedule.models.room.Room(*args, **kwargs)[source]

A Room is an actual place where talks will be scheduled.

The Room object stores some meta information. Most, like capacity, are not in use right now.

Parameters:
  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • name (I18nCharField) – Name

  • guid (UUIDField) – GUID. Unique identifier (UUID) to help external tools identify the room.

  • description (I18nCharField) – Description. A description for attendees, for example directions.

  • speaker_info (I18nCharField) – Speaker Information. Information relevant for speakers scheduled in this room, for example room size, special directions, available adaptors for video input …

  • capacity (PositiveIntegerField) – Capacity. How many people can fit in the room?

  • position (PositiveIntegerField) – Position

Relationship fields:

Parameters:

event (ForeignKey to Event) – Event (related name: rooms)

Reverse relationships:

Parameters:
  • availabilities (Reverse ForeignKey from Availability) – All availabilities of this room (related name of room)

  • talks (Reverse ForeignKey from TalkSlot) – All talks of this room (related name of room)

Emails and templates

class pretalx.mail.models.MailTemplate(*args, **kwargs)[source]

MailTemplates can be used to create.

QueuedMail objects.

The process does not come with variable substitution except for special cases, for now.

Parameters:
  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • subject (I18nCharField) – Subject

  • text (I18nTextField) – Text

  • reply_to (CharField) – Reply-To. Change the Reply-To address if you do not want to use the default organiser address

  • bcc (CharField) – BCC. Enter comma separated addresses. Will receive a blind copy of every mail sent from this template. This may be a LOT!

  • is_auto_created (BooleanField) – Is auto created

Relationship fields:

Parameters:

event (ForeignKey to Event) – Event (related name: mail_templates)

Reverse relationships:

Parameters:

mails (Reverse ForeignKey from QueuedMail) – All mails of this mail template (related name of template)

to_mail(user, event, locale=None, context=None, context_kwargs=None, skip_queue=False, commit=True, allow_empty_address=False, submissions=None, attachments=False)[source]

Creates a QueuedMail object from a MailTemplate.

Parameters:
  • user – Either a User or an email address as a string.

  • submissions (list) – A list of submissions to which this email belongs. This is handled as an addition to any submission object present in context_kwargs.

  • event – The event to which this email belongs. May be None.

  • locale (str) – The locale will be set via the event and the recipient, but can be overridden with this parameter.

  • context (dict) – Context to be used when rendering the template. Merged with all context available via get_mail_context.

  • context_kwargs (dict) – Passed to get_mail_context to retrieve the correct context when rendering the template.

  • skip_queue (bool) – Send directly. If combined with commit=False, this will remove any logging and traces.

  • commit (bool) – Set False to return an unsaved object.

class pretalx.mail.models.QueuedMail(*args, **kwargs)[source]

Emails in pretalx are rarely sent directly, hence the name QueuedMail.

This mechanism allows organisers to make sure they send out the right content, and to include personal changes in emails.

Parameters:
  • sentNone if the mail has not been sent yet.

  • to_users – All known users to whom this email is addressed.

  • to – A comma-separated list of email addresses to whom this email is addressed. Does not contain any email addresses known to belong to users.

  • id (AutoField) – Primary key: ID

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • reply_to (CharField) – Reply-To. By default, the organiser address is used as Reply-To.

  • cc (CharField) –

    1. One email address or several addresses separated by commas.

  • bcc (CharField) – BCC. One email address or several addresses separated by commas.

  • subject (CharField) – Subject

  • text (TextField) – Text

  • locale (CharField) – Locale

  • attachments (JSONField) – Attachments

Relationship fields:

Parameters:
copy_to_draft()[source]

Copies an already sent email to a new object and adds it to the outbox.

send(requestor=None, orga=True)[source]

Sends an email.

Parameters:
  • requestor (User) – The user issuing the command. Used for logging.

  • orga (bool) – Was this email sent as by a privileged user?

Utility models

class pretalx.common.models.log.ActivityLog(*args, **kwargs)[source]

This model logs actions within an event.

It is not designed to provide a complete or reliable audit trail.

Parameters:

Relationship fields:

Parameters: