119 if libconfig is not None: |
119 if libconfig is not None: |
120 libschema = libconfig.load_schema(remove_unused_rtypes=False) |
120 libschema = libconfig.load_schema(remove_unused_rtypes=False) |
121 entities = [e for e in schema.entities() if not e in libschema] |
121 entities = [e for e in schema.entities() if not e in libschema] |
122 else: |
122 else: |
123 entities = schema.entities() |
123 entities = schema.entities() |
|
124 rinlined = uicfg.autoform_is_inlined |
124 done = set() |
125 done = set() |
125 for eschema in sorted(entities): |
126 for eschema in sorted(entities): |
126 etype = eschema.type |
127 etype = eschema.type |
127 add_msg(w, etype) |
128 add_msg(w, etype) |
128 add_msg(w, '%s_plural' % etype) |
129 add_msg(w, '%s_plural' % etype) |
129 if not eschema.is_final(): |
130 if not eschema.is_final(): |
130 add_msg(w, 'This %s' % etype) |
131 add_msg(w, 'This %s' % etype) |
131 add_msg(w, 'New %s' % etype) |
132 add_msg(w, 'New %s' % etype) |
132 add_msg(w, 'add a %s' % etype) |
133 for rschema, targetschemas, role in eschema.relation_definitions(True): |
133 add_msg(w, 'remove this %s' % etype) |
134 targetschemas = [tschema for tschema in targetschemas |
|
135 if rinlined.etype_get(eschema, rschema, role, tschema)] |
|
136 for tschema in targetschemas: |
|
137 add_msg(w, 'add a %s' % tschema, |
|
138 'inlined:%s.%s.%s' % (etype, rschema, role)) |
|
139 add_msg(w, 'remove this %s' % tschema, |
|
140 'inlined:%s:%s:%s' % (etype, rschema, role)) |
134 if eschema.description and not eschema.description in done: |
141 if eschema.description and not eschema.description in done: |
135 done.add(eschema.description) |
142 done.add(eschema.description) |
136 add_msg(w, eschema.description) |
143 add_msg(w, eschema.description) |
137 w('# subject and object forms for each relation type\n') |
144 w('# subject and object forms for each relation type\n') |
138 w('# (no object form for final relation types)\n') |
145 w('# (no object form for final relation types)\n') |
141 relations = [r for r in schema.relations() if not r in libschema] |
148 relations = [r for r in schema.relations() if not r in libschema] |
142 else: |
149 else: |
143 relations = schema.relations() |
150 relations = schema.relations() |
144 for rschema in sorted(set(relations)): |
151 for rschema in sorted(set(relations)): |
145 rtype = rschema.type |
152 rtype = rschema.type |
146 add_msg(w, rtype) |
153 for subjschema in rschema.subjects(): |
|
154 add_msg(w, rtype, subjschema.type) |
147 done.add(rtype) |
155 done.add(rtype) |
148 if not (schema.rschema(rtype).is_final() or rschema.symetric): |
156 if not (schema.rschema(rtype).is_final() or rschema.symetric): |
149 add_msg(w, '%s_object' % rtype) |
157 add_msg(w, '%s_object' % rtype) |
150 if rschema.description and rschema.description not in done: |
158 if rschema.description and rschema.description not in done: |
151 done.add(rschema.description) |
159 done.add(rschema.description) |
155 appearsin_addmenu = uicfg.actionbox_appearsin_addmenu |
163 appearsin_addmenu = uicfg.actionbox_appearsin_addmenu |
156 for eschema in schema.entities(): |
164 for eschema in schema.entities(): |
157 if eschema.is_final(): |
165 if eschema.is_final(): |
158 continue |
166 continue |
159 for role, rschemas in (('subject', eschema.subject_relations()), |
167 for role, rschemas in (('subject', eschema.subject_relations()), |
160 ('object', eschema.object_relations())): |
168 ('object', eschema.object_relations())): |
161 for rschema in rschemas: |
169 for rschema in rschemas: |
162 if rschema.is_final(): |
170 if rschema.is_final(): |
163 continue |
171 continue |
164 if libconfig is not None: |
172 if libconfig is not None: |
165 librschema = libschema.get(rschema) |
173 librschema = libschema.get(rschema) |