Source code for org.forms.person

from onegov.core.utils import ensure_scheme
from onegov.form import Form
from onegov.org import _
from wtforms.validators import InputRequired
from wtforms.fields import EmailField
from wtforms.fields import StringField
from wtforms.fields import TextAreaField


[docs] class PersonForm(Form): """ Form to edit people. """
[docs] salutation = StringField(_('Salutation'))
[docs] academic_title = StringField(_('Academic Title'))
[docs] first_name = StringField(_('First name'), [InputRequired()])
[docs] last_name = StringField(_('Last name'), [InputRequired()])
[docs] function = StringField(_('Function'))
[docs] organisation = StringField(_('Organisation'))
[docs] sub_organisation = StringField(_('Sub organisation'))
[docs] email = EmailField(_('E-Mail'))
[docs] phone = StringField(_('Phone'))
[docs] phone_direct = StringField(_('Direct Phone Number or Mobile'))
[docs] born = StringField(_('Born'))
[docs] profession = StringField(_('Profession'))
[docs] political_party = StringField(_('Political Party'))
[docs] parliamentary_group = StringField(_('Parliamentary Group'))
[docs] website = StringField(_('Website'), filters=(ensure_scheme, ))
[docs] website_2 = StringField(_('Website 2'), filters=(ensure_scheme, ))
[docs] location_address = TextAreaField( label=_('Location address'), render_kw={'rows': 2} )
[docs] location_code_city = StringField(label=_('Location Code and City'))
[docs] postal_address = TextAreaField( label=_('Postal address'), render_kw={'rows': 2} )
[docs] postal_code_city = StringField(label=_('Postal Code and City'))
[docs] picture_url = StringField( label=_('Picture'), description=_('URL pointing to the picture'), render_kw={'class_': 'image-url'} )
[docs] notes = TextAreaField( label=_('Notes'), description=_('Public extra information about this person'), render_kw={'rows': 5} )