OpenSlides/openslides/assignment/forms.py

26 lines
699 B
Python
Raw Normal View History

2011-07-31 10:46:29 +02:00
# -*- coding: utf-8 -*-
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.utils.forms import CssClassMixin
from openslides.utils.person import PersonFormField
2012-07-10 11:27:06 +02:00
from .models import Assignment
2011-07-31 10:46:29 +02:00
2012-07-10 11:27:06 +02:00
class AssignmentForm(forms.ModelForm, CssClassMixin):
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
exclude = ('status', 'elected')
2011-07-31 10:46:29 +02:00
2012-07-10 11:27:06 +02:00
class AssignmentRunForm(forms.Form, CssClassMixin):
candidate = PersonFormField(
2012-07-10 11:27:06 +02:00
widget=forms.Select(attrs={'class': 'medium-input'}),
label=ugettext_lazy("Nominate a participant"),
)