2012-03-16 14:31:59 +01:00
|
|
|
from django import forms
|
2013-04-22 19:59:05 +02:00
|
|
|
from django.utils.translation import ugettext_lazy
|
2011-07-31 10:46:29 +02:00
|
|
|
|
2014-10-11 14:34:49 +02:00
|
|
|
from openslides.users.models import User
|
2012-07-10 14:00:51 +02:00
|
|
|
from openslides.utils.forms import CssClassMixin
|
2012-07-10 11:27:06 +02:00
|
|
|
|
2013-09-25 10:01:01 +02:00
|
|
|
from .models import Assignment
|
2011-07-31 10:46:29 +02:00
|
|
|
|
|
|
|
|
2014-01-11 17:07:47 +01:00
|
|
|
class AssignmentForm(CssClassMixin, forms.ModelForm):
|
2015-01-25 15:10:34 +01:00
|
|
|
open_posts = forms.IntegerField(
|
2013-04-22 19:59:05 +02:00
|
|
|
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
|
2015-01-25 15:10:34 +01:00
|
|
|
fields = ('title', 'description', 'open_posts', 'poll_description_default')
|
2011-07-31 10:46:29 +02:00
|
|
|
|
|
|
|
|
2014-01-11 17:07:47 +01:00
|
|
|
class AssignmentRunForm(CssClassMixin, forms.Form):
|
2014-10-11 14:34:49 +02:00
|
|
|
candidate = forms.ModelChoiceField(
|
|
|
|
queryset=User.objects.all(),
|
2012-07-10 11:27:06 +02:00
|
|
|
widget=forms.Select(attrs={'class': 'medium-input'}),
|
2014-01-11 17:07:47 +01:00
|
|
|
label=ugettext_lazy("Nominate a participant"))
|