symposion_app/vendor/symposion/reviews/forms.py

50 lines
1.1 KiB
Python
Raw Normal View History

2012-08-14 07:54:45 +00:00
from django import forms
from django.utils.translation import ugettext_lazy as _
2012-08-14 07:54:45 +00:00
from symposion.reviews.models import Review, Comment, ProposalMessage, VOTES
class ReviewForm(forms.ModelForm):
required_css_class = 'label-required'
2012-08-14 07:54:45 +00:00
class Meta:
model = Review
fields = ["vote", "comment"]
2014-07-30 18:19:26 +00:00
2012-08-14 07:54:45 +00:00
def __init__(self, *args, **kwargs):
super(ReviewForm, self).__init__(*args, **kwargs)
self.fields["vote"] = forms.ChoiceField(
2014-07-30 18:19:26 +00:00
widget=forms.RadioSelect(),
choices=VOTES.CHOICES
2012-08-14 07:54:45 +00:00
)
class ReviewCommentForm(forms.ModelForm):
required_css_class = 'label-required'
2012-08-14 07:54:45 +00:00
class Meta:
model = Comment
fields = ["text"]
class SpeakerCommentForm(forms.ModelForm):
required_css_class = 'label-required'
2012-08-14 07:54:45 +00:00
class Meta:
model = ProposalMessage
fields = ["message"]
class BulkPresentationForm(forms.Form):
required_css_class = 'label-required'
2012-08-14 07:54:45 +00:00
talk_ids = forms.CharField(
label=_("Talk ids"),
2012-08-14 07:54:45 +00:00
max_length=500,
help_text=_("Provide a comma seperated list of talk ids to accept.")
2012-08-14 07:54:45 +00:00
)