|
@@ -10,8 +10,8 @@ class List(MultipleRef):
|
10
|
10
|
# @param allowed_classes list | None : list of allowed em classes if None no restriction
|
11
|
11
|
# @param internal bool
|
12
|
12
|
# @param kwargs
|
13
|
|
- def __init__(self, allowed_classes=None, internal=False, **kwargs):
|
14
|
|
- super().__init__(allowed_classes=allowed_classes, internal=internal, **kwargs)
|
|
13
|
+ def __init__(self, max_length = None, **kwargs):
|
|
14
|
+ super().__init__(**kwargs)
|
15
|
15
|
|
16
|
16
|
## @brief Check value
|
17
|
17
|
# @param value *
|
|
@@ -20,6 +20,7 @@ class List(MultipleRef):
|
20
|
20
|
val, expt = super()._check_data_value()
|
21
|
21
|
if not isinstance(expt, Exception):
|
22
|
22
|
val = list(val)
|
|
23
|
+ val, expt = super()._check_data_value(value.values())
|
23
|
24
|
return val, expt
|
24
|
25
|
|
25
|
26
|
|
|
@@ -30,8 +31,8 @@ class Set(MultipleRef):
|
30
|
31
|
# @param allowed_classes list | None : list of allowed em classes if None no restriction
|
31
|
32
|
# @param internal bool : if False, the field is not internal
|
32
|
33
|
# @param kwargs : Other named arguments
|
33
|
|
- def __init__(self, allowed_classes=None, internal=False, **kwargs):
|
34
|
|
- super().__init__(allowed_classes=allowed_classes, internal=internal, **kwargs)
|
|
34
|
+ def __init__(self, **kwargs):
|
|
35
|
+ super().__init__(**kwargs)
|
35
|
36
|
|
36
|
37
|
## @brief Check value
|
37
|
38
|
# @param value *
|
|
@@ -40,6 +41,7 @@ class Set(MultipleRef):
|
40
|
41
|
val, expt = super()._check_data_value()
|
41
|
42
|
if not isinstance(expt, Exception):
|
42
|
43
|
val = set(val)
|
|
44
|
+ val, expt = super()._check_data_value(value.values())
|
43
|
45
|
return val, expt
|
44
|
46
|
|
45
|
47
|
|
|
@@ -50,8 +52,8 @@ class Map(MultipleRef):
|
50
|
52
|
# @param allowed_classes list | None : list of allowed em classes if None no restriction
|
51
|
53
|
# @param internal bool : if False, the field is not internal
|
52
|
54
|
# @param kwargs : Other named arguments
|
53
|
|
- def __init__(self, allowed_classes=None, internal=False, **kwargs):
|
54
|
|
- super().__init__(allowed_classes=allowed_classes, internal=internal, **kwargs)
|
|
55
|
+ def __init__(self, **kwargs):
|
|
56
|
+ super().__init__(**kwargs)
|
55
|
57
|
|
56
|
58
|
## @brief Check value
|
57
|
59
|
# @param value *
|
|
@@ -63,3 +65,13 @@ class Map(MultipleRef):
|
63
|
65
|
return (
|
64
|
66
|
None if isinstance(expt, Exception) else value,
|
65
|
67
|
expt)
|
|
68
|
+
|
|
69
|
+## @brief This Reference class is designed to handler hierarchy with some constraint
|
|
70
|
+class Hierarch(MultipleRef):
|
|
71
|
+
|
|
72
|
+ ## @brief Instanciate a data handler handling hierarchical relation with constraints
|
|
73
|
+ # @param back_reference tuple : Here it is mandatory to have a back ref (like a parent field)
|
|
74
|
+ # @param max_depth int | None : limit of depth
|
|
75
|
+ # @param max_childs int | Nine : maximum number of childs by nodes
|
|
76
|
+ def __init__(self, back_reference, max_depth = None, max_childs = None, **kwargs):
|
|
77
|
+ super().__init__(back_reference = back_reference)
|