Source code for election_day.forms.upload.party_results

from onegov.election_day import _
from onegov.election_day.forms.upload.common import ALLOWED_MIME_TYPES
from onegov.election_day.forms.upload.common import MAX_FILE_SIZE
from onegov.form import Form
from onegov.form.fields import UploadField
from onegov.form.validators import FileSizeLimit
from onegov.form.validators import WhitelistedMimeType
from wtforms.validators import DataRequired


[docs] class UploadPartyResultsForm(Form):
[docs] parties = UploadField( label=_('Party results'), validators=[ DataRequired(), WhitelistedMimeType(ALLOWED_MIME_TYPES), FileSizeLimit(MAX_FILE_SIZE) ], render_kw={'force_simple': True} )