OpenSlides/openslides/assignment/forms.py

36 lines
943 B
Python
Raw Normal View History

2011-07-31 10:46:29 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.assignment.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Forms for the assignment app.
:copyright: 20112013 by OpenSlides team, see AUTHORS.
2011-07-31 10:46:29 +02:00
:license: GNU GPL, see LICENSE for more details.
"""
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"),
)