2012-07-13 13:21:27 +00:00
|
|
|
from django import forms
|
|
|
|
|
|
|
|
from markitup.widgets import MarkItUpWidget
|
|
|
|
|
2012-10-31 18:56:21 +00:00
|
|
|
from symposion_project.proposals.models import TalkProposal, TutorialProposal, PosterProposal
|
2012-07-13 13:21:27 +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",
|
|
|
|
"audience_level",
|
|
|
|
"description",
|
|
|
|
"abstract",
|
|
|
|
"additional_notes",
|
|
|
|
"recording_release",
|
|
|
|
]
|
|
|
|
widgets = {
|
|
|
|
"abstract": MarkItUpWidget(),
|
|
|
|
"additional_notes": MarkItUpWidget(),
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class TutorialProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = TutorialProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"audience_level",
|
|
|
|
"description",
|
|
|
|
"abstract",
|
|
|
|
"additional_notes",
|
|
|
|
"recording_release",
|
|
|
|
|
|
|
|
]
|
|
|
|
widgets = {
|
|
|
|
"abstract": MarkItUpWidget(),
|
|
|
|
"additional_notes": MarkItUpWidget(),
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class PosterProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = PosterProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"audience_level",
|
|
|
|
"description",
|
|
|
|
"abstract",
|
|
|
|
"additional_notes",
|
|
|
|
"recording_release",
|
|
|
|
|
|
|
|
]
|
|
|
|
widgets = {
|
|
|
|
"abstract": MarkItUpWidget(),
|
|
|
|
"additional_notes": MarkItUpWidget(),
|
|
|
|
}
|