122 w('\n') |
122 w('\n') |
123 vregdone = set() |
123 vregdone = set() |
124 if libconfig is not None: |
124 if libconfig is not None: |
125 from cubicweb.cwvreg import CubicWebVRegistry, clear_rtag_objects |
125 from cubicweb.cwvreg import CubicWebVRegistry, clear_rtag_objects |
126 libschema = libconfig.load_schema(remove_unused_rtypes=False) |
126 libschema = libconfig.load_schema(remove_unused_rtypes=False) |
127 rinlined = deepcopy(uicfg.autoform_is_inlined) |
127 afs = deepcopy(uicfg.autoform_section) |
128 appearsin_addmenu = deepcopy(uicfg.actionbox_appearsin_addmenu) |
128 appearsin_addmenu = deepcopy(uicfg.actionbox_appearsin_addmenu) |
129 clear_rtag_objects() |
129 clear_rtag_objects() |
130 cleanup_sys_modules(libconfig) |
130 cleanup_sys_modules(libconfig) |
131 libvreg = CubicWebVRegistry(libconfig) |
131 libvreg = CubicWebVRegistry(libconfig) |
132 libvreg.set_schema(libschema) # trigger objects registration |
132 libvreg.set_schema(libschema) # trigger objects registration |
133 librinlined = uicfg.autoform_is_inlined |
133 libafs = uicfg.autoform_section |
134 libappearsin_addmenu = uicfg.actionbox_appearsin_addmenu |
134 libappearsin_addmenu = uicfg.actionbox_appearsin_addmenu |
135 # prefill vregdone set |
135 # prefill vregdone set |
136 list(_iter_vreg_objids(libvreg, vregdone)) |
136 list(_iter_vreg_objids(libvreg, vregdone)) |
137 else: |
137 else: |
138 libschema = {} |
138 libschema = {} |
139 rinlined = uicfg.autoform_is_inlined |
139 afs = uicfg.autoform_section |
140 appearsin_addmenu = uicfg.actionbox_appearsin_addmenu |
140 appearsin_addmenu = uicfg.actionbox_appearsin_addmenu |
141 done = set() |
141 done = set() |
142 for eschema in sorted(schema.entities()): |
142 for eschema in sorted(schema.entities()): |
143 etype = eschema.type |
143 etype = eschema.type |
144 if etype not in libschema: |
144 if etype not in libschema: |
152 add_msg(w, eschema.description) |
152 add_msg(w, eschema.description) |
153 if eschema.is_final(): |
153 if eschema.is_final(): |
154 continue |
154 continue |
155 for rschema, targetschemas, role in eschema.relation_definitions(True): |
155 for rschema, targetschemas, role in eschema.relation_definitions(True): |
156 for tschema in targetschemas: |
156 for tschema in targetschemas: |
157 if rinlined.etype_get(eschema, rschema, role, tschema) and \ |
157 fsections = afs.etype_get(eschema, rschema, role, tschema) |
|
158 if 'inlined_attributes' in fsections and \ |
158 (libconfig is None or not |
159 (libconfig is None or not |
159 librinlined.etype_get(eschema, rschema, role, tschema)): |
160 'inlined_attributes' in libafs.etype_get( |
|
161 eschema, rschema, role, tschema)): |
160 add_msg(w, 'add a %s' % tschema, |
162 add_msg(w, 'add a %s' % tschema, |
161 'inlined:%s.%s.%s' % (etype, rschema, role)) |
163 'inlined:%s.%s.%s' % (etype, rschema, role)) |
162 add_msg(w, 'remove this %s' % tschema, |
164 add_msg(w, 'remove this %s' % tschema, |
163 'inlined:%s.%s.%s' % (etype, rschema, role)) |
165 'inlined:%s.%s.%s' % (etype, rschema, role)) |
164 add_msg(w, 'This %s' % tschema, |
166 add_msg(w, 'This %s' % tschema, |