web/views/schema.py
changeset 8216 99ff746e8de8
parent 8190 2a3c1b787688
parent 8213 076c80543fcd
child 8665 e65af61bde7d
equal deleted inserted replaced
8214:ce9556358dbd 8216:99ff746e8de8
   203     def render_entity_attributes(self, entity):
   203     def render_entity_attributes(self, entity):
   204         super(CWETypeDescriptionTab, self).render_entity_attributes(entity)
   204         super(CWETypeDescriptionTab, self).render_entity_attributes(entity)
   205         _ = self._cw._
   205         _ = self._cw._
   206         # inheritance
   206         # inheritance
   207         if entity.specializes:
   207         if entity.specializes:
   208             self.w(u'<div>%s' % _('Parent class:'))
   208             self.w(u'<div><strong>%s</strong>' % _('Parent class:'))
   209             self.wview('csv', entity.related('specializes', 'subject'))
   209             self.wview('csv', entity.related('specializes', 'subject'))
   210             self.w(u'</div>')
   210             self.w(u'</div>')
   211         if entity.reverse_specializes:
   211         if entity.reverse_specializes:
   212             self.w(u'<div>%s' % _('Sub-classes:'))
   212             self.w(u'<div><strong>%s</strong>' % _('Sub-classes:'))
   213             self.wview('csv', entity.related('specializes', 'object'))
   213             self.wview('csv', entity.related('specializes', 'object'))
   214             self.w(u'</div>')
   214             self.w(u'</div>')
   215         # entity schema image
   215         # entity schema image
   216         self.wview('schemagraph', etype=entity.name)
   216         self.wview('schemagraph', etype=entity.name)
   217         # entity schema attributes
   217         # entity schema attributes
   564                 'fontsize': '10px'
   564                 'fontsize': '10px'
   565                 }
   565                 }
   566 
   566 
   567     def edge_properties(self, rschema, subjnode, objnode):
   567     def edge_properties(self, rschema, subjnode, objnode):
   568         """return default DOT drawing options for a relation schema"""
   568         """return default DOT drawing options for a relation schema"""
       
   569         # Inheritance relation (i.e 'specializes').
       
   570         if rschema is None:
       
   571             kwargs = {'label': 'Parent class',
       
   572                       'color' : 'grey',  'style' : 'filled',
       
   573                       'arrowhead': 'empty',
       
   574                       'fontsize': '10px'}
   569         # symmetric rels are handled differently, let yams decide what's best
   575         # symmetric rels are handled differently, let yams decide what's best
   570         if rschema.symmetric:
   576         elif rschema.symmetric:
   571             kwargs = {'label': rschema.type,
   577             kwargs = {'label': rschema.type,
   572                       'color': '#887788', 'style': 'dashed',
   578                       'color': '#887788', 'style': 'dashed',
   573                       'dir': 'both', 'arrowhead': 'normal', 'arrowtail': 'normal',
   579                       'dir': 'both', 'arrowhead': 'normal', 'arrowtail': 'normal',
   574                       'fontsize': '10px',
   580                       'fontsize': '10px',
   575                       'href': self.cw.build_url('cwrtype/%s' % rschema.type)}
   581                       'href': self.cw.build_url('cwrtype/%s' % rschema.type)}