2015-10-16 17:53:02 +00:00
|
|
|
from django import forms
|
|
|
|
|
2016-06-29 13:17:15 +00:00
|
|
|
from pinaxcon import widgets
|
|
|
|
|
2016-06-21 11:47:45 +00:00
|
|
|
from .models import TalkProposal, TutorialProposal, MiniconfProposal
|
2016-09-23 11:23:46 +00:00
|
|
|
from .models import SysAdminProposal, WriteTheDocsProposal, WootconfProposal
|
|
|
|
from .models import KernelProposal, OpenRadioProposal, SecurityProposal
|
2016-09-27 08:10:41 +00:00
|
|
|
from .models import GamesProposal, TestingProposal, LawProposal
|
|
|
|
from .models import KnowledgeProposal
|
2015-10-16 17:53:02 +00:00
|
|
|
|
|
|
|
class ProposalForm(forms.ModelForm):
|
|
|
|
|
|
|
|
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 = TalkProposal
|
|
|
|
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
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-21 11:47:45 +00:00
|
|
|
class TutorialProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = TutorialProposal
|
|
|
|
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
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-21 11:47:45 +00:00
|
|
|
class MiniconfProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = MiniconfProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
]
|
2016-06-29 13:17:15 +00:00
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
2016-09-23 11:23:46 +00:00
|
|
|
|
|
|
|
class SysAdminProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = SysAdminProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"talk_format",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
class WriteTheDocsProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = WriteTheDocsProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"talk_format",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
class RadioProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = OpenRadioProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
2016-09-26 21:47:05 +00:00
|
|
|
"target_audience",
|
2016-09-23 11:23:46 +00:00
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
2016-09-25 05:38:15 +00:00
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
2016-09-23 11:23:46 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
class KernelProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = KernelProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
2016-09-26 21:47:05 +00:00
|
|
|
"target_audience",
|
2016-09-23 11:23:46 +00:00
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
2016-09-25 05:38:15 +00:00
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
2016-09-23 11:23:46 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
class WootconfProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = WootconfProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
2016-09-26 21:47:05 +00:00
|
|
|
"target_audience",
|
2016-09-23 11:23:46 +00:00
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
2016-09-25 05:38:15 +00:00
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
2016-09-23 11:23:46 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
class SecurityProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = SecurityProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
2016-09-26 21:47:05 +00:00
|
|
|
"target_audience",
|
2016-09-23 11:23:46 +00:00
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
2016-09-25 05:38:15 +00:00
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
class GamesProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = GamesProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"talk_format",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
2016-09-23 11:23:46 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
2016-09-27 08:10:41 +00:00
|
|
|
|
|
|
|
class TestingProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = TestingProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
class KnowledgeProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = KnowledgeProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|
|
|
|
|
|
|
|
class LawProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = LawProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
|
|
|
widgets = {
|
|
|
|
"abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"private_abstract" : widgets.AceMarkdownEditor(),
|
|
|
|
"technical_requirements" : widgets.AceMarkdownEditor(),
|
|
|
|
}
|