2017-09-22 02:48:09 +00:00
|
|
|
import copy
|
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
from django import forms
|
|
|
|
|
2018-10-05 19:43:50 +00:00
|
|
|
from pinaxcon.proposals.fields import HelpTextField
|
2019-09-28 06:03:41 +00:00
|
|
|
from pinaxcon.proposals import models
|
2018-10-01 02:09:33 +00:00
|
|
|
|
2017-09-22 02:48:09 +00:00
|
|
|
|
|
|
|
DEFAULT_FIELDS = [
|
|
|
|
"title",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
|
|
|
TALK_FORMAT_FIELDS = copy.copy(DEFAULT_FIELDS)
|
2018-09-30 04:04:28 +00:00
|
|
|
TALK_FORMAT_FIELDS.insert(2, "talk_format")
|
2019-09-28 06:03:41 +00:00
|
|
|
TALK_FORMAT_FIELDS.append("ticket_acknowledgement")
|
2017-03-05 07:34:15 +00:00
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
class ProposalForm(forms.ModelForm):
|
|
|
|
|
2017-04-24 13:10:51 +00:00
|
|
|
required_css_class = 'label-required'
|
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
def clean_description(self):
|
|
|
|
value = self.cleaned_data["description"]
|
|
|
|
if len(value) > 400:
|
|
|
|
raise forms.ValidationError(
|
|
|
|
u"The description must be less than 400 characters"
|
|
|
|
)
|
|
|
|
return value
|
|
|
|
|
|
|
|
|
|
|
|
class TalkProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
2019-09-28 06:03:41 +00:00
|
|
|
model = models.TalkProposal
|
2015-10-16 17:53:02 +00:00
|
|
|
fields = [
|
|
|
|
"title",
|
2016-06-20 23:58:27 +00:00
|
|
|
"target_audience",
|
2015-10-16 17:53:02 +00:00
|
|
|
"abstract",
|
2016-06-20 23:58:27 +00:00
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"video_url",
|
2015-10-16 17:53:02 +00:00
|
|
|
"recording_release",
|
2016-06-20 23:58:27 +00:00
|
|
|
"materials_release",
|
2015-10-16 17:53:02 +00:00
|
|
|
]
|
2016-06-21 11:47:45 +00:00
|
|
|
|
2016-06-29 13:17:15 +00:00
|
|
|
|
2016-06-21 11:47:45 +00:00
|
|
|
class TutorialProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
2019-09-28 06:03:41 +00:00
|
|
|
model = models.TutorialProposal
|
2016-06-21 11:47:45 +00:00
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"video_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
2016-06-29 13:17:15 +00:00
|
|
|
|
2016-06-21 11:47:45 +00:00
|
|
|
class MiniconfProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
2019-09-28 06:03:41 +00:00
|
|
|
model = models.MiniconfProposal
|
2016-06-21 11:47:45 +00:00
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
2017-07-02 12:28:29 +00:00
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
2016-06-21 11:47:45 +00:00
|
|
|
]
|
2019-09-28 06:03:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
### LCA2020 Miniconfs
|
|
|
|
|
|
|
|
class MiniconfProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
def __init__(self, *a, **k):
|
|
|
|
super(MiniconfProposalForm, self).__init__(*a, **k)
|
|
|
|
self.fields['ticket_acknowledgement'].required = True
|
|
|
|
|
|
|
|
|
|
|
|
class ContainersProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.ContainersProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class CreativeArtsProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.CreativeArtsProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class DocsProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.DocsProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class FreeBsdProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.FreeBsdProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class GamesProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.GamesProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class GlamProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.GlamProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class KernelProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.KernelProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class OpenEducationProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.OpenEducationProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class OpenHardwareProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.OpenHardwareProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class OpenIsaProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.OpenIsaProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class SecurityProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.SecurityProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class SysAdminProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.SysAdminProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|