symposion_app/pinaxcon/proposals/forms.py

164 lines
4.2 KiB
Python
Raw Normal View History

import copy
from django import forms
2018-10-05 19:43:50 +00:00
from pinaxcon.proposals.fields import HelpTextField
from pinaxcon.proposals import models
2018-10-01 02:09:33 +00:00
DEFAULT_FIELDS = [
"title",
# "primary_topic",
"target_audience",
2021-08-09 11:12:43 +00:00
"experience_level",
"abstract",
"private_abstract",
2023-04-20 07:47:34 +00:00
# "content_warning",
"technical_requirements",
# "project",
# "project_url",
2023-04-20 07:47:34 +00:00
# "video_url",
2021-08-09 11:12:43 +00:00
"require_approval",
"recording_release",
"materials_release",
2023-04-24 01:59:37 +00:00
"indicate_use_of_proprietary_software",
]
TALK_FORMAT_FIELDS = copy.copy(DEFAULT_FIELDS)
TALK_FORMAT_FIELDS.insert(2, "talk_format")
class ProposalForm(forms.ModelForm):
required_css_class = 'label-required'
2023-04-24 01:59:37 +00:00
indicate_use_of_proprietary_software = forms.BooleanField(
help_text="Attendees expect to see only FOSS presented at all FOSSY talks. I affirm that I will clearly mark any proprietary and/or trade secret software on talk slides, in any printed materially and will verbally indicate any non-FOSS mentioned in my talk.")
2023-04-24 01:59:37 +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:
model = models.TalkProposal
fields = copy.copy(DEFAULT_FIELDS)
class TutorialProposalForm(ProposalForm):
class Meta:
model = models.TutorialProposal
fields = copy.copy(DEFAULT_FIELDS)
class MiniconfProposalForm(ProposalForm):
pass
2024-05-15 12:43:11 +00:00
class AIAndMachineLearningProposalForm(MiniconfProposalForm):
class Meta:
2024-05-15 12:29:33 +00:00
model = models.AIAndMachineLearningProposal
fields = TALK_FORMAT_FIELDS
2023-04-20 07:47:34 +00:00
2024-05-15 12:43:11 +00:00
class DiversityEquityAndInclusionProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.DiversityEquityAndInclusionProposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class FOSSAndARM64ProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.FOSSAndARM64Proposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class FOSSFundingandEconomicsProposalForm(MiniconfProposalForm):
class Meta:
2024-05-15 12:29:33 +00:00
model = models.FOSSFundingandEconomicsProposal
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class FOSSInDailyLifeProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.FOSSInDailyLifeProposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class FOSSInEducationProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.FOSSInEducationProposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-23 12:12:12 +00:00
class KeynotePanelProposalForm(MiniconfProposalForm):
class Meta:
model = models.KeynotePanelProposal
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class LicensingAndLegalIssuesProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.LicensingAndLegalIssuesProposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class MobileDeviceUserFreedomProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.MobileDeviceUserFreedomProposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class ReproducibilityProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.ReproducibilityProposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class RightToRepairProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.RightToRepairProposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-28 13:01:43 +00:00
class SeleniumProposalForm(MiniconfProposalForm):
class Meta:
model = models.SeleniumProposal
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class ScienceOfCommunityProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
model = models.ScienceOfCommunityProposal
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class MemberProjectsProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.MemberProjectsProposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class SupportingUserGroupsProposalForm(MiniconfProposalForm):
2023-04-20 07:47:34 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.SupportingUserGroupsProposal
2023-04-20 07:47:34 +00:00
fields = TALK_FORMAT_FIELDS
2023-04-23 23:22:00 +00:00
2024-05-15 12:43:11 +00:00
class XMPPProposalForm(MiniconfProposalForm):
2023-04-24 21:49:50 +00:00
class Meta:
2024-05-15 12:29:33 +00:00
model = models.XMPPProposal
2023-04-24 21:49:50 +00:00
fields = TALK_FORMAT_FIELDS
2024-05-15 12:43:11 +00:00
class WildCardProposalForm(MiniconfProposalForm):
2023-04-23 23:22:00 +00:00
class Meta:
model = models.WildCardProposal
fields = TALK_FORMAT_FIELDS