Source code for pas.forms.commission

from onegov.form import Form
from onegov.form.fields import TranslatedSelectField
from onegov.org.forms.fields import HtmlField
from onegov.pas import _
from onegov.pas.models.commission import TYPES
from wtforms.fields import DateField
from wtforms.fields import StringField
from wtforms.validators import InputRequired
from wtforms.validators import Optional


[docs] class CommissionForm(Form):
[docs] name = StringField( label=_('Name'), validators=[InputRequired()], )
[docs] start = DateField( label=_('Start'), validators=[Optional()], )
[docs] end = DateField( label=_('End'), validators=[Optional()], )
[docs] type = TranslatedSelectField( label=_('Type'), choices=list(TYPES.items()), validators=[InputRequired()], default='normal' )
[docs] description = HtmlField( label=_('Description'), )