Browse Source

BugFix on graphviz backend with new EmField

Yann Weber 9 years ago
parent
commit
aaa39feeea
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      EditorialModel/backend/graphviz.py

+ 5
- 2
EditorialModel/backend/graphviz.py View File

1
 # -*- coding: utf-8 -*-
1
 # -*- coding: utf-8 -*-
2
 
2
 
3
 import datetime
3
 import datetime
4
+import EditorialModel
4
 from EditorialModel.classtypes import EmClassType
5
 from EditorialModel.classtypes import EmClassType
5
 from EditorialModel.fieldgroups import EmFieldGroup
6
 from EditorialModel.fieldgroups import EmFieldGroup
6
 from EditorialModel.types import EmType
7
 from EditorialModel.types import EmType
88
             for f in c.fields():
89
             for f in c.fields():
89
                 if ((cn == 'EmType' and f.optional) or (cn == 'EmFieldGroup' and not f.optional)) and f.rel_field_id is None:
90
                 if ((cn == 'EmType' and f.optional) or (cn == 'EmFieldGroup' and not f.optional)) and f.rel_field_id is None:
90
                     
91
                     
91
-                    if not (f.rel_to_type_id is None):
92
+                    #if not (f.rel_to_type_id is None):
93
+                    if isinstance(f, EditorialModel.fieldtypes.rel2type.EmFieldRel2Type):
92
                         rel_node_id = '%s%s'%(EmBackendGraphviz._component_id(c), EmBackendGraphviz._component_id(em.component(f.rel_to_type_id)))
94
                         rel_node_id = '%s%s'%(EmBackendGraphviz._component_id(c), EmBackendGraphviz._component_id(em.component(f.rel_to_type_id)))
93
 
95
 
94
                         rel_node = '\t%s [ label="rel_to_type'%rel_node_id
96
                         rel_node = '\t%s [ label="rel_to_type'%rel_node_id
114
                     if first:
116
                     if first:
115
                         ret += ' { '
117
                         ret += ' { '
116
                         first = False
118
                         first = False
117
-                    if not (f.rel_to_type_id is None):
119
+                    #if not (f.rel_to_type_id is None):
120
+                    if isinstance(f, EditorialModel.fieldtypes.rel2type.EmFieldRel2Type):
118
                         ret += '<f%d> '%cntref
121
                         ret += '<f%d> '%cntref
119
                         cntref += 1
122
                         cntref += 1
120
                     ret += f.name
123
                     ret += f.name

Loading…
Cancel
Save