symposion_app/pinaxcon/proposals/forms.py
2015-10-16 12:53:02 -05:00

28 lines
636 B
Python

from django import forms
from .models import TalkProposal
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",
]