devtools/devctl.py
branch3.5
changeset 3275 5247789df541
parent 3221 3422d2188940
child 3280 c1f5625f2fea
--- a/devtools/devctl.py	Wed Sep 16 21:23:35 2009 +0200
+++ b/devtools/devctl.py	Wed Sep 16 21:29:17 2009 +0200
@@ -121,6 +121,7 @@
         entities = [e for e in schema.entities() if not e in libschema]
     else:
         entities = schema.entities()
+    rinlined = uicfg.autoform_is_inlined
     done = set()
     for eschema in sorted(entities):
         etype = eschema.type
@@ -129,8 +130,14 @@
         if not eschema.is_final():
             add_msg(w, 'This %s' % etype)
             add_msg(w, 'New %s' % etype)
-            add_msg(w, 'add a %s' % etype)
-            add_msg(w, 'remove this %s' % etype)
+            for rschema, targetschemas, role in eschema.relation_definitions(True):
+                targetschemas = [tschema for tschema in targetschemas
+                                 if rinlined.etype_get(eschema, rschema, role, tschema)]
+                for tschema in targetschemas:
+                    add_msg(w, 'add a %s' % tschema,
+                            'inlined:%s.%s.%s' % (etype, rschema, role))
+                    add_msg(w, 'remove this %s' % tschema,
+                            'inlined:%s:%s:%s' % (etype, rschema, role))
         if eschema.description and not eschema.description in done:
             done.add(eschema.description)
             add_msg(w, eschema.description)
@@ -143,7 +150,8 @@
         relations = schema.relations()
     for rschema in sorted(set(relations)):
         rtype = rschema.type
-        add_msg(w, rtype)
+        for subjschema in rschema.subjects():
+            add_msg(w, rtype, subjschema.type)
         done.add(rtype)
         if not (schema.rschema(rtype).is_final() or rschema.symetric):
             add_msg(w, '%s_object' % rtype)
@@ -157,7 +165,7 @@
         if eschema.is_final():
             continue
         for role, rschemas in (('subject', eschema.subject_relations()),
-                            ('object', eschema.object_relations())):
+                               ('object', eschema.object_relations())):
             for rschema in rschemas:
                 if rschema.is_final():
                     continue