OpenSlides/openslides/assignments/forms.py

24 lines
750 B
Python
Raw Normal View History

2012-03-16 14:31:59 +01:00
from django import forms
from django.utils.translation import ugettext_lazy
2011-07-31 10:46:29 +02:00
from openslides.users.models import User
from openslides.utils.forms import CssClassMixin
2012-07-10 11:27:06 +02:00
from .models import Assignment
2011-07-31 10:46:29 +02:00
class AssignmentForm(CssClassMixin, forms.ModelForm):
open_posts = forms.IntegerField(
min_value=1, initial=1, label=ugettext_lazy("Number of available posts"))
2012-07-10 11:27:06 +02:00
2011-07-31 10:46:29 +02:00
class Meta:
model = Assignment
fields = ('title', 'description', 'open_posts', 'poll_description_default')
2011-07-31 10:46:29 +02:00
class AssignmentRunForm(CssClassMixin, forms.Form):
candidate = forms.ModelChoiceField(
queryset=User.objects.all(),
2012-07-10 11:27:06 +02:00
widget=forms.Select(attrs={'class': 'medium-input'}),
label=ugettext_lazy("Nominate a participant"))