|
@@ -27,7 +27,8 @@ LodelContext.expose_modules(globals(), {
|
27
|
27
|
'lodel.validator.validator': [
|
28
|
28
|
'ValidationError'
|
29
|
29
|
],
|
30
|
|
- 'lodel.logger': 'logger'})
|
|
30
|
+ 'lodel.logger': 'logger',
|
|
31
|
+ 'lodel.utils.mlstring': ['MlString']})
|
31
|
32
|
|
32
|
33
|
|
33
|
34
|
## @brief Base class for all data handlers
|
|
@@ -74,7 +75,10 @@ class DataHandler(MlNamedObject):
|
74
|
75
|
for argname, argval in kwargs.items():
|
75
|
76
|
setattr(self, argname, argval)
|
76
|
77
|
self.check_options()
|
77
|
|
- super().__init__(self.display_name, self.help_text)
|
|
78
|
+
|
|
79
|
+ display_name = kwargs.get('display_name',MlString(self.display_name))
|
|
80
|
+ help_text = kwargs.get('help_text', MlString(self.help_text))
|
|
81
|
+ super().__init__(display_name, help_text)
|
78
|
82
|
|
79
|
83
|
## @brief Sets properly casted and checked options for the datahandler
|
80
|
84
|
# @raises LodelDataHandlerNotAllowedOptionException when a passed option is not in the option
|
|
@@ -376,7 +380,7 @@ class Reference(DataHandler):
|
376
|
380
|
# logger.warning('Object referenced does not exist')
|
377
|
381
|
# return False
|
378
|
382
|
return True
|
379
|
|
-
|
|
383
|
+
|
380
|
384
|
## @brief Utility method designed to fetch referenced objects
|
381
|
385
|
# @param value mixed : the field value
|
382
|
386
|
# @throw NotImplementedError
|
|
@@ -445,7 +449,7 @@ class MultipleRef(Reference):
|
445
|
449
|
if self.max_item is not None:
|
446
|
450
|
if self.max_item < len(value):
|
447
|
451
|
raise FieldValidationError("Too many items")
|
448
|
|
- new_val = list()
|
|
452
|
+ new_val = list()
|
449
|
453
|
error_list = list()
|
450
|
454
|
for i, v in enumerate(value):
|
451
|
455
|
try:
|