symposion_app/pinaxcon/proposals/forms.py
2024-05-28 23:01:43 +10:00

163 lines
4.2 KiB
Python

import copy
from django import forms
from pinaxcon.proposals.fields import HelpTextField
from pinaxcon.proposals import models
DEFAULT_FIELDS = [
"title",
# "primary_topic",
"target_audience",
"experience_level",
"abstract",
"private_abstract",
# "content_warning",
"technical_requirements",
# "project",
# "project_url",
# "video_url",
"require_approval",
"recording_release",
"materials_release",
"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'
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.")
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
class AIAndMachineLearningProposalForm(MiniconfProposalForm):
class Meta:
model = models.AIAndMachineLearningProposal
fields = TALK_FORMAT_FIELDS
class DiversityEquityAndInclusionProposalForm(MiniconfProposalForm):
class Meta:
model = models.DiversityEquityAndInclusionProposal
fields = TALK_FORMAT_FIELDS
class FOSSAndARM64ProposalForm(MiniconfProposalForm):
class Meta:
model = models.FOSSAndARM64Proposal
fields = TALK_FORMAT_FIELDS
class FOSSFundingandEconomicsProposalForm(MiniconfProposalForm):
class Meta:
model = models.FOSSFundingandEconomicsProposal
fields = TALK_FORMAT_FIELDS
class FOSSInDailyLifeProposalForm(MiniconfProposalForm):
class Meta:
model = models.FOSSInDailyLifeProposal
fields = TALK_FORMAT_FIELDS
class FOSSInEducationProposalForm(MiniconfProposalForm):
class Meta:
model = models.FOSSInEducationProposal
fields = TALK_FORMAT_FIELDS
class KeynotePanelProposalForm(MiniconfProposalForm):
class Meta:
model = models.KeynotePanelProposal
fields = TALK_FORMAT_FIELDS
class LicensingAndLegalIssuesProposalForm(MiniconfProposalForm):
class Meta:
model = models.LicensingAndLegalIssuesProposal
fields = TALK_FORMAT_FIELDS
class MobileDeviceUserFreedomProposalForm(MiniconfProposalForm):
class Meta:
model = models.MobileDeviceUserFreedomProposal
fields = TALK_FORMAT_FIELDS
class ReproducibilityProposalForm(MiniconfProposalForm):
class Meta:
model = models.ReproducibilityProposal
fields = TALK_FORMAT_FIELDS
class RightToRepairProposalForm(MiniconfProposalForm):
class Meta:
model = models.RightToRepairProposal
fields = TALK_FORMAT_FIELDS
class SeleniumProposalForm(MiniconfProposalForm):
class Meta:
model = models.SeleniumProposal
fields = TALK_FORMAT_FIELDS
class ScienceOfCommunityProposalForm(MiniconfProposalForm):
class Meta:
model = models.ScienceOfCommunityProposal
fields = TALK_FORMAT_FIELDS
class MemberProjectsProposalForm(MiniconfProposalForm):
class Meta:
model = models.MemberProjectsProposal
fields = TALK_FORMAT_FIELDS
class SupportingUserGroupsProposalForm(MiniconfProposalForm):
class Meta:
model = models.SupportingUserGroupsProposal
fields = TALK_FORMAT_FIELDS
class XMPPProposalForm(MiniconfProposalForm):
class Meta:
model = models.XMPPProposal
fields = TALK_FORMAT_FIELDS
class WildCardProposalForm(MiniconfProposalForm):
class Meta:
model = models.WildCardProposal
fields = TALK_FORMAT_FIELDS