diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2014-08-25 22:55:30 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2014-08-25 22:55:30 +0200 |
commit | 9f336bbde2c228dd8e493a3820c0787c6f880b25 (patch) | |
tree | 1a3409490020596dacd189d3bbbe2afb2f4b65ff /app | |
parent | 00e8320d57fc40a22f52fd1496ac1de373a816be (diff) | |
download | kosten-9f336bbde2c228dd8e493a3820c0787c6f880b25.tar.gz kosten-9f336bbde2c228dd8e493a3820c0787c6f880b25.tar.bz2 kosten-9f336bbde2c228dd8e493a3820c0787c6f880b25.zip |
Port for WTForms2 (partially)
Diffstat (limited to '')
-rw-r--r-- | app/forms.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/forms.py b/app/forms.py index 250bc21..0bbb745 100644 --- a/app/forms.py +++ b/app/forms.py @@ -2,10 +2,9 @@ import flask from flask.ext.wtf import Form as _Form from wtforms.fields import BooleanField, DateField, IntegerField, StringField, HiddenField, PasswordField -from wtforms import fields, validators, ValidationError +from wtforms import fields, validators, ValidationError, Form as WTForm from wtforms.ext.sqlalchemy.fields import QuerySelectField -from wtforms.ext.i18n.form import Form as i18nForm from . import app @@ -21,9 +20,9 @@ class DecimalField(fields.DecimalField): req = [validators.input_required()] -class Form(_Form, i18nForm): - # docs say LOCALES, code says LANGUAGES ... use both :) - LANGUAGES = LOCALES = ['de_DE', 'de'] +class Form(_Form): + class Meta: + locales = ['de_DE', 'de'] def __init__ (self, *args, **kwargs): self._msg = kwargs.pop('flash', u"Fehler im Formular!") @@ -46,4 +45,4 @@ class Form(_Form, i18nForm): # use WTForms builtin translation support instead of the flask-babael # stuff added by flask-wtf # FIXME: remove this, if flask-babel is used in the app - return i18nForm._get_translations(self) + return WTForm._get_translations(self) |