2011-07-31 10:46:29 +02:00
|
|
|
|
#!/usr/bin/env python
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
openslides.assignment.forms
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
Forms for the assignment app.
|
|
|
|
|
|
2013-03-01 17:13:12 +01:00
|
|
|
|
:copyright: 2011–2013 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
|
2013-04-22 19:59:05 +02:00
|
|
|
|
from django.utils.translation import ugettext_lazy
|
2011-07-31 10:46:29 +02:00
|
|
|
|
|
2012-07-10 14:00:51 +02:00
|
|
|
|
from openslides.utils.forms import CssClassMixin
|
2012-08-07 22:43:57 +02:00
|
|
|
|
from openslides.utils.person import PersonFormField
|
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
|
|
|
|
|
|
|
|
|
|
2012-07-10 11:27:06 +02:00
|
|
|
|
class AssignmentForm(forms.ModelForm, CssClassMixin):
|
2012-11-24 14:01:21 +01:00
|
|
|
|
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
|
2012-08-04 15:02:02 +02:00
|
|
|
|
exclude = ('status', 'elected')
|
2011-07-31 10:46:29 +02:00
|
|
|
|
|
|
|
|
|
|
2012-07-10 11:27:06 +02:00
|
|
|
|
class AssignmentRunForm(forms.Form, CssClassMixin):
|
2012-08-07 22:43:57 +02:00
|
|
|
|
candidate = PersonFormField(
|
2012-07-10 11:27:06 +02:00
|
|
|
|
widget=forms.Select(attrs={'class': 'medium-input'}),
|
2013-04-22 19:59:05 +02:00
|
|
|
|
label=ugettext_lazy("Nominate a participant"),
|
2012-02-20 18:44:02 +01:00
|
|
|
|
)
|