|
@@ -25,16 +25,16 @@ class EmType(EmComponent):
|
25
|
25
|
## Instanciate a new EmType
|
26
|
26
|
# @todo define and check types for icon and sortcolumn
|
27
|
27
|
# @todo better check self.subordinates
|
28
|
|
- def __init__(self, model, uid, name, class_id, fields_list = [], superiors_list = {}, icon = '0', sortcolumn = 'rank', string = None, help_text = None, date_update = None, date_create = None, rank = None):
|
|
28
|
+ def __init__(self, model, uid, name, class_id, fields_list = None, superiors_list = None, icon = '0', sortcolumn = 'rank', string = None, help_text = None, date_update = None, date_create = None, rank = None):
|
29
|
29
|
self.class_id = class_id
|
30
|
30
|
self.check_type('class_id', int)
|
31
|
|
- self.fields_list = fields_list
|
|
31
|
+ self.fields_list = fields_list if fields_list is not None else []
|
32
|
32
|
self.check_type('fields_list', list)
|
33
|
33
|
for l_uid in self.fields_list:
|
34
|
34
|
if not isinstance(l_uid, int):
|
35
|
35
|
raise AttributeError("Excepted fields_list to be a list of integers, but found a +"+str(type(l_uid))+" in it")
|
36
|
36
|
|
37
|
|
- self.superiors_list = superiors_list
|
|
37
|
+ self.superiors_list = superiors_list if superiors_list is not None else {}
|
38
|
38
|
self.check_type('superiors_list', dict)
|
39
|
39
|
for nature, sup_uid in self.superiors_list.items():
|
40
|
40
|
if nature not in [EmNature.PARENT, EmNature.TRANSLATION, EmNature.IDENTITY]:
|