|
@@ -2,6 +2,7 @@
|
2
|
2
|
import warnings
|
3
|
3
|
import inspect
|
4
|
4
|
from lodel.leapi.datahandlers.datas_base import *
|
|
5
|
+import re
|
5
|
6
|
|
6
|
7
|
##@brief Data field designed to handle formated strings
|
7
|
8
|
class FormatString(Varchar):
|
|
@@ -46,7 +47,7 @@ max_length and regex'
|
46
|
47
|
|
47
|
48
|
def _check_data_value(self, value):
|
48
|
49
|
error = None
|
49
|
|
- if not self.compiled_re.match(value):
|
|
50
|
+ if not self.compiled_re.match(value) or len(value) > self.max_length:
|
50
|
51
|
value = ''
|
51
|
52
|
msg = '"%s" doesn\'t match the regex "%s"' % (value, self.regex)
|
52
|
53
|
error = TypeError(msg)
|