summaryrefslogtreecommitdiff
path: root/kosten/app/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'kosten/app/forms.py')
-rw-r--r--kosten/app/forms.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/kosten/app/forms.py b/kosten/app/forms.py
index 9bab284..818384d 100644
--- a/kosten/app/forms.py
+++ b/kosten/app/forms.py
@@ -31,6 +31,10 @@ class MonthField(HTML4DateField):
req = [validators.input_required()]
+def lenOf(col):
+ if hasattr(col.type, 'length') and col.type.length:
+ return [validators.length(max = col.type.length)]
+
class Form(FlaskForm):
class Meta:
locales = False