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 thepretalx.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
toOrganiser
) – Organiser (related name:events
)
Reverse relationships:
- Parameters:
log_entries (Reverse
ForeignKey
fromActivityLog
) – All log entries of this event (related name ofevent
)_settings_objects (Reverse
ForeignKey
fromEvent_SettingsStore
) – All settings objects of this event (related name ofobject
)team (Reverse
ManyToManyField
fromTeam
) – All teams of this event (related name oflimit_events
)mail_templates (Reverse
ForeignKey
fromMailTemplate
) – All mail templates of this event (related name ofevent
)queued_mails (Reverse
ForeignKey
fromQueuedMail
) – All queued mails of this event (related name ofevent
)information (Reverse
ForeignKey
fromSpeakerInformation
) – All information of this event (related name ofevent
)availabilities (Reverse
ForeignKey
fromAvailability
) – All availabilities of this event (related name ofevent
)rooms (Reverse
ForeignKey
fromRoom
) – All rooms of this event (related name ofevent
)schedules (Reverse
ForeignKey
fromSchedule
) – All schedules of this event (related name ofevent
)submitter_access_codes (Reverse
ForeignKey
fromSubmitterAccessCode
) – All submitter access codes of this event (related name ofevent
)cfp (Reverse
OneToOneField
fromCfP
) – The cf p of this event (related name ofevent
)questions (Reverse
ForeignKey
fromQuestion
) – All questions of this event (related name ofevent
)score_categories (Reverse
ForeignKey
fromReviewScoreCategory
) – All score categories of this event (related name ofevent
)review_phases (Reverse
ForeignKey
fromReviewPhase
) – All review phases of this event (related name ofevent
)submissions (Reverse
ForeignKey
fromSubmission
) – All submissions of this event (related name ofevent
)tags (Reverse
ForeignKey
fromTag
) – All tags of this event (related name ofevent
)tracks (Reverse
ForeignKey
fromTrack
) – All tracks of this event (related name ofevent
)submission_types (Reverse
ForeignKey
fromSubmissionType
) – All submission types of this event (related name ofevent
)
- 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:
- 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:
- 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:
- release_schedule(name, user=None, notify_speakers=False, comment=None)[source]¶
Releases a new
Schedule
by finalising the current WIP schedule.
- 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.
- 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.
- class pretalx.event.models.organiser.Organiser(*args, **kwargs)[source]¶
The Organiser model represents the entity responsible for at least one.
- 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
fromEvent
) – All events of this organiser (related name oforganiser
)teams (Reverse
ForeignKey
fromTeam
) – All teams of this organiser (related name oforganiser
)
- 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 ofOrganiser
. 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:
organiser (
ForeignKey
toOrganiser
) – Organiser (related name:teams
)members (
ManyToManyField
toUser
) – Team members (related name:teams
)limit_events (
ManyToManyField
toEvent
) – Limit permissions to these events (related name:team
)limit_tracks (
ManyToManyField
toTrack
) – Limit to tracks (related name:team
)
Reverse relationships:
- Parameters:
invites (Reverse
ForeignKey
fromTeamInvite
) – All invites of this team (related name ofteam
)
- 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:
event (
OneToOneField
toEvent
) – Event (related name:cfp
)default_type (
ForeignKey
toSubmissionType
) – Default session type (related name:+
)
- is_open¶
True
ifmax_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
toEvent
) – Event (related name:review_phases
)
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
andcheck_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. If possible, upload an image that is least 120 pixels wide.
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
fromToken
) – The auth token of this user (related name ofuser
)log_entries (Reverse
ForeignKey
fromActivityLog
) – All log entries of this user (related name ofperson
)teams (Reverse
ManyToManyField
fromTeam
) – All teams of this user (related name ofmembers
)mails (Reverse
ManyToManyField
fromQueuedMail
) – All mails of this user (related name ofto_users
)profiles (Reverse
ForeignKey
fromSpeakerProfile
) – All profiles of this user (related name ofuser
)feedback (Reverse
ForeignKey
fromFeedback
) – All feedback of this user (related name ofspeaker
)answers (Reverse
ForeignKey
fromAnswer
) – All answers of this user (related name ofperson
)reviews (Reverse
ForeignKey
fromReview
) – All reviews of this user (related name ofuser
)submissions (Reverse
ManyToManyField
fromSubmission
) – All submissions of this user (related name ofspeakers
)assigned_reviews (Reverse
ManyToManyField
fromSubmission
) – All assigned reviews of this user (related name ofassigned_reviewers
)submission_favourites (Reverse
ForeignKey
fromSubmissionFavourite
) – All submission favourites of this user (related name ofuser
)
- event_profile(event)[source]¶
Retrieve (and/or create) the event.
SpeakerProfile
for this user.- Retval:
pretalx.person.models.profile.EventProfile
- 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:
- class pretalx.person.models.profile.SpeakerProfile(*args, **kwargs)[source]¶
All
Event
related data concerning a.User
is stored here.- Parameters:
has_arrived – Can be set to track speaker arrival. Will be used in warnings about missing speakers.
id (AutoField) – Primary key: ID
created (DateTimeField) – Created
updated (DateTimeField) – Updated
biography (TextField) – Biography. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.
Relationship fields:
- Parameters:
user (
ForeignKey
toUser
) – User (related name:profiles
)event (
ForeignKey
toEvent
) – Event (related name:+
)
Reverse relationships:
- Parameters:
availabilities (Reverse
ForeignKey
fromAvailability
) – All availabilities of this speaker profile (related name ofperson
)
- 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:
id (AutoField) – Primary key: ID
created (DateTimeField) – Created
updated (DateTimeField) – Updated
target_group (CharField) – Target group
title (I18nCharField) – Subject
text (I18nTextField) – Text. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.
resource (FileField) – File. Please try to keep your upload small, preferably below 16 MB.
Relationship fields:
- Parameters:
event (
ForeignKey
toEvent
) – Event (related name:information
)limit_tracks (
ManyToManyField
toTrack
) – Limit to tracks. Leave empty to show this information to all tracks. (related name:speakerinformation
)limit_types (
ManyToManyField
toSubmissionType
) – 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
, aTrack
, multipleAnswer
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()
. TheSubmissionStates
class comes with amethod_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:
event (
ForeignKey
toEvent
) – Event (related name:submissions
)submission_type (
ForeignKey
toSubmissionType
) – Session type (related name:submissions
)track (
ForeignKey
toTrack
) – Track (related name:submissions
)access_code (
ForeignKey
toSubmitterAccessCode
) – Access code (related name:submissions
)speakers (
ManyToManyField
toUser
) – Speakers (related name:submissions
)tags (
ManyToManyField
toTag
) – Tags (related name:submissions
)assigned_reviewers (
ManyToManyField
toUser
) – Assigned reviewers (related name:assigned_reviews
)
Reverse relationships:
- Parameters:
slots (Reverse
ForeignKey
fromTalkSlot
) – All slots of this submission (related name ofsubmission
)feedback (Reverse
ForeignKey
fromFeedback
) – All feedback of this submission (related name oftalk
)answers (Reverse
ForeignKey
fromAnswer
) – All answers of this submission (related name ofsubmission
)resources (Reverse
ForeignKey
fromResource
) – All resources of this submission (related name ofsubmission
)reviews (Reverse
ForeignKey
fromReview
) – All reviews of this submission (related name ofsubmission
)favourites (Reverse
ForeignKey
fromSubmissionFavourite
) – All favourites of this submission (related name ofsubmission
)
- 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:
- 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.
- update_duration()[source]¶
Apply the submission’s duration to its currently scheduled.
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.
- class pretalx.submission.models.review.Review(*args, **kwargs)[source]¶
Reviews model the opinion of reviewers of a.
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 theupdate_score
method instead.id (AutoField) – Primary key: ID
created (DateTimeField) – Created
updated (DateTimeField) – Updated
Relationship fields:
- Parameters:
submission (
ForeignKey
toSubmission
) – Submission (related name:reviews
)user (
ForeignKey
toUser
) – User (related name:reviews
)scores (
ManyToManyField
toReviewScore
) – Scores (related name:reviews
)
Reverse relationships:
- Parameters:
answers (Reverse
ForeignKey
fromAnswer
) – All answers of this review (related name ofreview
)
- classmethod find_missing_reviews(event, user, ignore=None)[source]¶
Returns all
Submission
objects thisUser
still has to review for the givenEvent
. A subset offind_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.
- Parameters:
speaker – If the
speaker
attribute is not set, the feedback is assumed to be directed to all speakers.id (AutoField) – Primary key: ID
created (DateTimeField) – Created
updated (DateTimeField) – Updated
rating (IntegerField) – Rating
review (TextField) – Feedback. You can use <a href=”https://docs.pretalx.org/user/markdown/” target=”_blank” rel=”noopener”>Markdown</a> here.
Relationship fields:
- Parameters:
talk (
ForeignKey
toSubmission
) – Session (related name:feedback
)
- class pretalx.submission.models.track.Track(*args, **kwargs)[source]¶
A track groups
Submission
objects within anEvent
, 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
toEvent
) – Event (related name:tracks
)
Reverse relationships:
- Parameters:
team (Reverse
ManyToManyField
fromTeam
) – All teams of this track (related name oflimit_tracks
)speakerinformation (Reverse
ManyToManyField
fromSpeakerInformation
) – All speaker informations of this track (related name oflimit_tracks
)submitter_access_codes (Reverse
ForeignKey
fromSubmitterAccessCode
) – All submitter access codes of this track (related name oftrack
)questions (Reverse
ManyToManyField
fromQuestion
) – All questions of this track (related name oftracks
)reviewscorecategory (Reverse
ManyToManyField
fromReviewScoreCategory
) – All review score categorys of this track (related name oflimit_tracks
)submissions (Reverse
ForeignKey
fromSubmission
) – All submissions of this track (related name oftrack
)
- 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
toEvent
) – Event (related name:submission_types
)
Reverse relationships:
- Parameters:
speakerinformation (Reverse
ManyToManyField
fromSpeakerInformation
) – All speaker informations of this submission type (related name oflimit_types
)submitter_access_codes (Reverse
ForeignKey
fromSubmitterAccessCode
) – All submitter access codes of this submission type (related name ofsubmission_type
)questions (Reverse
ManyToManyField
fromQuestion
) – All questions of this submission type (related name ofsubmission_types
)submissions (Reverse
ForeignKey
fromSubmission
) – All submissions of this submission type (related name ofsubmission_type
)
- update_duration()[source]¶
Updates the duration of all.
TalkSlot
objects ofSubmission
objects of this type.Runs only for submissions that do not override their default duration. Should be called whenever
duration
changes.
- class pretalx.submission.models.resource.Resource(*args, **kwargs)[source]¶
Resources are file uploads belonging to a
Submission
.- Parameters:
id (AutoField) – Primary key: ID
created (DateTimeField) – Created
updated (DateTimeField) – Updated
resource (FileField) – File
link (URLField) – URL
description (CharField) – Description
Relationship fields:
- Parameters:
submission (
ForeignKey
toSubmission
) – 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 perReview
.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
toEvent
) – Event (related name:questions
)tracks (
ManyToManyField
toTrack
) – Tracks. You can limit this question to some tracks. Leave this field empty to apply to all tracks. (related name:questions
)submission_types (
ManyToManyField
toSubmissionType
) – 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
fromAnswerOption
) – All options of this question (related name ofquestion
)answers (Reverse
ForeignKey
fromAnswer
) – All answers of this question (related name ofquestion
)
- class pretalx.submission.models.question.AnswerOption(*args, **kwargs)[source]¶
Provides the possible answers for.
Question
objects of variant ‘choice’ or ‘multiple_choice’.- Parameters:
id (AutoField) – Primary key: ID
created (DateTimeField) – Created
updated (DateTimeField) – Updated
answer (I18nCharField) – Answer
Relationship fields:
- Parameters:
question (
ForeignKey
toQuestion
) – Question (related name:options
)
Reverse relationships:
- Parameters:
answers (Reverse
ManyToManyField
fromAnswer
) – All answers of this answer option (related name ofoptions
)
- class pretalx.submission.models.question.Answer(*args, **kwargs)[source]¶
Answers are connected to a.
Question
, and, depending on type, aUser
, aSubmission
, or aReview
.- Parameters:
id (AutoField) – Primary key: ID
created (DateTimeField) – Created
updated (DateTimeField) – Updated
answer (TextField) – Answer
answer_file (FileField) – Answer file
Relationship fields:
- Parameters:
question (
ForeignKey
toQuestion
) – Question (related name:answers
)submission (
ForeignKey
toSubmission
) – Submission (related name:answers
)person (
ForeignKey
toUser
) – Person (related name:answers
)review (
ForeignKey
toReview
) – Review (related name:answers
)options (
ManyToManyField
toAnswerOption
) – Options (related name:answers
)
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 anEvent
.- Parameters:
published –
None
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
toEvent
) – Event (related name:schedules
)
Reverse relationships:
- Parameters:
talks (Reverse
ForeignKey
fromTalkSlot
) – All talks of this schedule (related name ofschedule
)
- freeze(name, user=None, notify_speakers=True, comment=None)[source]¶
Releases the current WIP schedule as a fixed schedule version.
- Parameters:
- Return type:
- changes¶
Returns a dictionary of changes when compared to the previous version.
The
action
field is eithercreate
orupdate
. If it’s an update, thecount
integer, and thenew_talks
,canceled_talks
andmoved_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 withTalkSlot
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
andupdate
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, andno_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.
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:
submission (
ForeignKey
toSubmission
) – Submission (related name:slots
)room (
ForeignKey
toRoom
) – Room. The room this talk is scheduled in, if any (related name:talks
)schedule (
ForeignKey
toSchedule
) – Schedule (related name:talks
)
- 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:
- 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 ifend
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:
id (AutoField) – Primary key: ID
created (DateTimeField) – Created
updated (DateTimeField) – Updated
start (DateTimeField) – Start
end (DateTimeField) – End
Relationship fields:
- Parameters:
event (
ForeignKey
toEvent
) – Event (related name:availabilities
)person (
ForeignKey
toSpeakerProfile
) – Person (related name:availabilities
)room (
ForeignKey
toRoom
) – Room (related name:availabilities
)
- __and__(other)[source]¶
Performs the intersect operation:
availability1 & availability2
- Return type:
- __eq__(other)[source]¶
Comparisons like
availability1 == availability2
.Checks if
event
,person
,room
,start
andend
are the same.- Return type:
- contains(other)[source]¶
Tests if this availability starts before and ends after the other.
- Return type:
- intersect_with(other)[source]¶
Return a new Availability which spans the range covered both by this one and the given one.
- Return type:
- classmethod intersection(*availabilitysets)[source]¶
Return the list of Availabilities which are covered by all of the given sets.
- Return type:
- merge_with(other)[source]¶
Return a new Availability which spans the range of this one and the given one.
- Return type:
- classmethod union(availabilities)[source]¶
Return the minimal list of Availability objects which are covered by at least one given Availability.
- Return type:
- 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
toEvent
) – Event (related name:rooms
)
Reverse relationships:
- Parameters:
availabilities (Reverse
ForeignKey
fromAvailability
) – All availabilities of this room (related name ofroom
)talks (Reverse
ForeignKey
fromTalkSlot
) – All talks of this room (related name ofroom
)
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
toEvent
) – Event (related name:mail_templates
)
Reverse relationships:
- Parameters:
mails (Reverse
ForeignKey
fromQueuedMail
) – All mails of this mail template (related name oftemplate
)
- to_mail(user, event, locale=None, context=None, context_kwargs=None, skip_queue=False, commit=True, full_submission_content=False, allow_empty_address=False, attachments=False)[source]¶
Creates a
QueuedMail
object from a MailTemplate.- Parameters:
user – Either a
User
or an email address as a string.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
) – SetFalse
to return an unsaved object.full_submission_content (
bool
) – Attach the complete submission with all its fields to the email.
- 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:
sent –
None
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) –
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:
event (
ForeignKey
toEvent
) – Event (related name:queued_mails
)template (
ForeignKey
toMailTemplate
) – Template (related name:mails
)
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:
is_orga_action – True, if the logged action was performed by a privileged user.
id (AutoField) – Primary key: ID
object_id (PositiveIntegerField) – Object id
timestamp (DateTimeField) – Timestamp
action_type (CharField) – Action type
data (TextField) – Data
content_object (GenericForeignKey) – Generic foreign key to the
ContentType
specified incontent_type
Relationship fields:
- Parameters:
event (
ForeignKey
toEvent
) – Event (related name:log_entries
)person (
ForeignKey
toUser
) – Person (related name:log_entries
)content_type (
ForeignKey
toContentType
) – Content type (related name:activitylog
)