OpenSlides/openslides/assignment/forms.py

33 lines
903 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: 2011 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from django.forms import ModelForm, Form, ModelChoiceField, Select
from django.utils.translation import ugettext as _
from utils.forms import CssClassMixin
2011-07-31 10:46:29 +02:00
from participant.models import Profile
from assignment.models import Assignment
class AssignmentForm(ModelForm, CssClassMixin):
2011-07-31 10:46:29 +02:00
class Meta:
model = Assignment
exclude = ('status', 'profile', 'elected')
2011-07-31 10:46:29 +02:00
class AssignmentRunForm(Form, CssClassMixin):
2011-07-31 10:46:29 +02:00
candidate = ModelChoiceField(
widget=Select(attrs={'class': 'medium-input'}),
queryset=Profile.objects.all().order_by('user__first_name'),
label=_("Nominate a participant"),
)