summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2014-08-25 22:55:30 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2014-08-25 22:55:30 +0200
commit9f336bbde2c228dd8e493a3820c0787c6f880b25 (patch)
tree1a3409490020596dacd189d3bbbe2afb2f4b65ff /app
parent00e8320d57fc40a22f52fd1496ac1de373a816be (diff)
downloadkosten-9f336bbde2c228dd8e493a3820c0787c6f880b25.tar.gz
kosten-9f336bbde2c228dd8e493a3820c0787c6f880b25.tar.bz2
kosten-9f336bbde2c228dd8e493a3820c0787c6f880b25.zip
Port for WTForms2 (partially)
Diffstat (limited to '')
-rw-r--r--app/forms.py11
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)