|
@@ -107,7 +107,7 @@ class RandomEm(object):
|
107
|
107
|
emtype.add_superior(possible[nat][i], nat)
|
108
|
108
|
|
109
|
109
|
#fields creation
|
110
|
|
- ft_l = EmField.fieldtypes_list()
|
|
110
|
+ ft_l = [ ftname for ftname in EmField.fieldtypes_list() if ftname != 'pk' ]
|
111
|
111
|
for emfg in ed_mod.components(EmFieldGroup):
|
112
|
112
|
if random.randint(0, chances['nofields']) != 0:
|
113
|
113
|
for _ in range(random.randint(1, chances['nfields'])):
|
|
@@ -123,8 +123,8 @@ class RandomEm(object):
|
123
|
123
|
ed_mod.create_component('EmField', fdats)
|
124
|
124
|
|
125
|
125
|
#relationnal fiels creation
|
126
|
|
- ft_l = [field_type for field_type in EmField.fieldtypes_list() if field_type != 'rel2type']
|
127
|
|
- for emrelf in [f for f in ed_mod.components(EmField) if f.ftype == 'rel2type']:
|
|
126
|
+ ft_l = [field_type for field_type in EmField.fieldtypes_list() if field_type != 'rel2type' and field_type != 'pk']
|
|
127
|
+ for emrelf in [f for f in ed_mod.components(EmField) if f.fieldtype == 'rel2type']:
|
128
|
128
|
for _ in range(0, chances['rfields']):
|
129
|
129
|
field_type = ft_l[random.randint(0, len(ft_l) - 1)]
|
130
|
130
|
fdats = cls._rnd_component_datas()
|