Files
@ 40f4d1bb8d07
Branch filter:
Location: symposion_app/symposion_project/proposals/forms.py - annotation
40f4d1bb8d07
2.0 KiB
text/x-python
display available teams on dashboard and remove debugging print
80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 80d2c2d73626 | from django import forms
from markitup.widgets import MarkItUpWidget
from symposion_project.proposals.models import ProposalCategory, TalkProposal, TutorialProposal, PosterProposal
class ProposalForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ProposalForm, self).__init__(*args, **kwargs)
self.fields["category"] = forms.ModelChoiceField(
queryset = ProposalCategory.objects.order_by("name")
)
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",
"category",
"audience_level",
"description",
"abstract",
"additional_notes",
"recording_release",
]
widgets = {
"abstract": MarkItUpWidget(),
"additional_notes": MarkItUpWidget(),
}
class TutorialProposalForm(ProposalForm):
class Meta:
model = TutorialProposal
fields = [
"title",
"category",
"audience_level",
"description",
"abstract",
"additional_notes",
"recording_release",
]
widgets = {
"abstract": MarkItUpWidget(),
"additional_notes": MarkItUpWidget(),
}
class PosterProposalForm(ProposalForm):
class Meta:
model = PosterProposal
fields = [
"title",
"category",
"audience_level",
"description",
"abstract",
"additional_notes",
"recording_release",
]
widgets = {
"abstract": MarkItUpWidget(),
"additional_notes": MarkItUpWidget(),
}
|