2012-07-12 04:38:24 +00:00
|
|
|
import datetime
|
|
|
|
|
2015-09-08 20:07:24 +00:00
|
|
|
from django.db import models
|
2020-11-22 12:21:54 +00:00
|
|
|
from django.urls import reverse
|
2015-09-08 20:07:24 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2012-07-12 04:38:24 +00:00
|
|
|
|
2020-11-22 12:21:54 +00:00
|
|
|
from django.contrib.auth import get_user_model
|
2012-07-12 04:38:24 +00:00
|
|
|
|
2021-07-05 10:20:24 +00:00
|
|
|
from timezone_field import TimeZoneField
|
|
|
|
|
2017-05-07 03:22:28 +00:00
|
|
|
from symposion import constants
|
|
|
|
from symposion.text_parser import parse
|
2012-07-12 04:38:24 +00:00
|
|
|
|
2020-11-22 12:21:54 +00:00
|
|
|
User = get_user_model()
|
|
|
|
|
2012-07-12 04:38:24 +00:00
|
|
|
|
|
|
|
class Speaker(models.Model):
|
2014-07-30 18:19:26 +00:00
|
|
|
|
2020-11-22 12:21:54 +00:00
|
|
|
user = models.OneToOneField(
|
|
|
|
User,
|
|
|
|
null=True,
|
|
|
|
related_name="speaker_profile",
|
|
|
|
verbose_name=_("User"),
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
)
|
2015-06-26 03:46:09 +00:00
|
|
|
name = models.CharField(verbose_name=_("Name"), max_length=100,
|
|
|
|
help_text=_("As you would like it to appear in the"
|
2016-07-03 02:14:07 +00:00
|
|
|
" conference programme."))
|
2022-12-07 14:08:54 +00:00
|
|
|
pronouns = models.CharField(verbose_name=_("Pronouns"),
|
|
|
|
max_length=20,
|
|
|
|
blank=True,
|
|
|
|
)
|
2016-06-19 03:19:32 +00:00
|
|
|
biography = models.TextField(
|
|
|
|
blank=True,
|
|
|
|
help_text=_("This will appear on the conference website and in the "
|
|
|
|
"programme. Please write in the third person, eg 'Alice "
|
2017-05-07 03:22:28 +00:00
|
|
|
"is a Moblin hacker...', 150-200 words. " +
|
|
|
|
constants.TEXT_FIELD_MONOSPACE_NOTE),
|
2016-06-19 03:19:32 +00:00
|
|
|
verbose_name=_("Biography"),
|
|
|
|
)
|
2015-10-16 17:36:58 +00:00
|
|
|
biography_html = models.TextField(blank=True)
|
2016-06-19 03:19:32 +00:00
|
|
|
experience = models.TextField(
|
|
|
|
blank=True,
|
|
|
|
help_text=_("Have you had any experience presenting elsewhere? If so, "
|
|
|
|
"we'd like to know. Anything you put here will only be "
|
|
|
|
"seen by the organisers and reviewers; use it to convince "
|
2017-05-07 03:22:28 +00:00
|
|
|
"them why they should accept your proposal. " +
|
|
|
|
constants.TEXT_FIELD_MONOSPACE_NOTE),
|
2016-06-19 03:19:32 +00:00
|
|
|
verbose_name=_("Speaking experience"),
|
|
|
|
)
|
|
|
|
experience_html = models.TextField(blank=True)
|
2015-06-26 03:46:09 +00:00
|
|
|
photo = models.ImageField(upload_to="speaker_photos", blank=True, verbose_name=_("Photo"))
|
2016-06-19 03:19:32 +00:00
|
|
|
telephone = models.CharField(
|
|
|
|
max_length=15,
|
|
|
|
help_text=_(u"The conference team will need this to contact you "
|
|
|
|
"during the conference week. If you don't have one, or do "
|
|
|
|
"not wish to provide it, then enter NONE in this field.")
|
|
|
|
)
|
2021-07-05 10:20:24 +00:00
|
|
|
local_timezone = TimeZoneField(
|
|
|
|
blank=True,
|
|
|
|
verbose_name=_("Local Timezone"),
|
|
|
|
help_text=_("Your local timezone, preferably the one you will use to "
|
|
|
|
"present from. The conference organisers will "
|
|
|
|
"use this to assist with scheduling talks.")
|
|
|
|
)
|
2016-06-19 03:19:32 +00:00
|
|
|
homepage = models.URLField(
|
|
|
|
blank=True,
|
|
|
|
help_text=_(u"Your home page, if you have one")
|
|
|
|
)
|
2016-03-15 03:24:14 +00:00
|
|
|
twitter_username = models.CharField(
|
|
|
|
max_length=15,
|
|
|
|
blank=True,
|
|
|
|
help_text=_(u"Your Twitter account")
|
|
|
|
)
|
2022-12-07 14:08:54 +00:00
|
|
|
mastodon_username = models.CharField(
|
|
|
|
max_length=100,
|
|
|
|
blank=True,
|
|
|
|
help_text=_(u"Your Mastodon account")
|
|
|
|
)
|
2016-06-18 03:53:02 +00:00
|
|
|
accessibility = models.TextField(
|
|
|
|
blank=True,
|
2018-07-12 00:11:55 +00:00
|
|
|
help_text=_("Let us know how we can help you during the conference, for example "
|
2023-04-20 01:54:36 +00:00
|
|
|
"your accessibility requirements, if you require a Visa invitation letter, whether you require access to child "
|
|
|
|
"minding facilities or anything else you think we should know about."),
|
2018-07-12 00:11:55 +00:00
|
|
|
verbose_name=_("Other requirements"))
|
2016-06-19 03:19:32 +00:00
|
|
|
accessibility_html = models.TextField(blank=True)
|
2016-06-18 03:53:02 +00:00
|
|
|
travel_assistance = models.BooleanField(
|
|
|
|
blank=True,
|
2016-06-18 06:50:11 +00:00
|
|
|
default=False,
|
2022-12-07 14:08:54 +00:00
|
|
|
help_text=_("Check this box if you require assistance to travel to the conference "
|
2019-06-24 11:59:47 +00:00
|
|
|
"in order to present your proposed sessions."),
|
2016-06-18 03:53:02 +00:00
|
|
|
verbose_name=_("Travel assistance required"),
|
|
|
|
)
|
|
|
|
accommodation_assistance = models.BooleanField(
|
|
|
|
blank=True,
|
2016-06-18 06:50:11 +00:00
|
|
|
default=False,
|
2019-06-24 11:59:47 +00:00
|
|
|
help_text=_("Check this box if you require us to provide you with accommodation "
|
|
|
|
"in order to present your proposed sessions."),
|
2016-06-18 03:53:02 +00:00
|
|
|
verbose_name=_("Accommodation assistance required"),
|
|
|
|
)
|
2019-06-24 11:59:47 +00:00
|
|
|
assistance = models.TextField(
|
|
|
|
blank=True,
|
|
|
|
help_text=_("We have budget set aside to provide financial assistance to "
|
2022-12-07 14:08:54 +00:00
|
|
|
"speakers and attendees who might otherwise find it difficult to attend. "
|
2019-06-24 11:59:47 +00:00
|
|
|
"Please provide details on why you require travel and/or accommodation assistance "
|
|
|
|
"in order to present your proposed sessions. "
|
|
|
|
"For travel assistance, please also tell us where you will be coming from "
|
|
|
|
"(country, state, etc) to assist with planning."),
|
|
|
|
verbose_name=_("Travel/Accommodation assistance details"))
|
|
|
|
assistance_html = models.TextField(blank=True)
|
2016-06-19 04:00:17 +00:00
|
|
|
agreement = models.BooleanField(
|
|
|
|
default=False,
|
2017-07-02 06:08:15 +00:00
|
|
|
help_text=_("I agree to the "
|
2018-06-29 23:41:37 +00:00
|
|
|
"<a href=\"/attend/terms-and-conditions\"> "
|
2017-07-02 06:08:15 +00:00
|
|
|
"terms and conditions of attendance</a>, and I have read, "
|
|
|
|
"understood, and agree to act according to the standards set "
|
|
|
|
"forth in our "
|
2018-06-29 23:41:37 +00:00
|
|
|
"<a href=\"/attend/code-of-conduct\">"
|
2017-07-02 06:08:15 +00:00
|
|
|
"Code of Conduct</a>.")
|
2016-06-19 04:00:17 +00:00
|
|
|
)
|
2016-06-18 03:53:02 +00:00
|
|
|
|
2015-06-26 03:46:09 +00:00
|
|
|
annotation = models.TextField(verbose_name=_("Annotation")) # staff only
|
|
|
|
invite_email = models.CharField(max_length=200, unique=True, null=True, db_index=True, verbose_name=_("Invite_email"))
|
|
|
|
invite_token = models.CharField(max_length=40, db_index=True, verbose_name=_("Invite token"))
|
2012-07-12 04:38:24 +00:00
|
|
|
created = models.DateTimeField(
|
2014-07-30 18:19:26 +00:00
|
|
|
default=datetime.datetime.now,
|
2015-06-26 03:46:09 +00:00
|
|
|
editable=False,
|
|
|
|
verbose_name=_("Created")
|
2012-07-12 04:38:24 +00:00
|
|
|
)
|
2013-04-29 21:00:58 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
ordering = ['name']
|
2015-06-26 03:46:09 +00:00
|
|
|
verbose_name = _("Speaker")
|
|
|
|
verbose_name_plural = _("Speakers")
|
2016-12-30 08:21:36 +00:00
|
|
|
permissions = (('can_view_contact_details', 'Can View Contact Details'),)
|
2014-07-30 18:19:26 +00:00
|
|
|
|
2015-10-16 17:36:58 +00:00
|
|
|
def save(self, *args, **kwargs):
|
|
|
|
self.biography_html = parse(self.biography)
|
2016-06-19 03:19:32 +00:00
|
|
|
self.experience_html = parse(self.experience)
|
2016-06-19 04:07:43 +00:00
|
|
|
self.accessibility_html = parse(self.accessibility)
|
2019-06-24 11:59:47 +00:00
|
|
|
self.assistance_html = parse(self.assistance)
|
2015-10-16 17:36:58 +00:00
|
|
|
return super(Speaker, self).save(*args, **kwargs)
|
|
|
|
|
2015-07-18 07:09:17 +00:00
|
|
|
def __str__(self):
|
2012-07-12 04:38:24 +00:00
|
|
|
if self.user:
|
|
|
|
return self.name
|
|
|
|
else:
|
2015-07-18 07:09:17 +00:00
|
|
|
return "?"
|
2013-04-29 21:00:58 +00:00
|
|
|
|
2012-07-12 04:38:24 +00:00
|
|
|
def get_absolute_url(self):
|
|
|
|
return reverse("speaker_edit")
|
2014-07-30 18:19:26 +00:00
|
|
|
|
2012-07-12 04:38:24 +00:00
|
|
|
@property
|
|
|
|
def email(self):
|
|
|
|
if self.user is not None:
|
|
|
|
return self.user.email
|
|
|
|
else:
|
|
|
|
return self.invite_email
|
2014-07-30 18:19:26 +00:00
|
|
|
|
2012-12-20 06:51:52 +00:00
|
|
|
@property
|
|
|
|
def all_presentations(self):
|
|
|
|
presentations = []
|
|
|
|
if self.presentations:
|
|
|
|
for p in self.presentations.all():
|
|
|
|
presentations.append(p)
|
|
|
|
for p in self.copresentations.all():
|
|
|
|
presentations.append(p)
|
|
|
|
return presentations
|
2021-11-28 11:41:45 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
def code(self):
|
|
|
|
""" A unique string that identifies this speaker. """
|
|
|
|
return f"{self.pk}"
|