def model_to_dotnode(self, model): meta = model._meta id = self.get_dotid(model) values = [] if self.show_values: values = self.modelfields_to_umlfields(model) label = UmlClassLabel(self.get_title(model), values=values) return Node(id, label)
def test_few_nodes(self): self.t( u''' graph g1 { n1; n2; n3 } ''', Graph(strict=None, type=u'graph', id=u'g1', stmts=[ Node(id=u'n1', attrs=[]), Node(id=u'n2', attrs=[]), Node(id=u'n3', attrs=[]) ]))
def manytomany_to_dotnode(self, field, id): values = [] if self.show_values: values = [ UmlField(field.m2m_column_name(), 'integer'), # TODO: make this use the actual type UmlField(field.m2m_reverse_name(), 'integer') ] # TODO: make this use the actual type label = UmlClassLabel(field.m2m_db_table(), values=values) return Node(id, label)
def test_few_attrs(self): self.t( u''' digraph g1 { n1 [attr1, attr2 = value2]; } ''', Graph(strict=None, type=u'digraph', id=u'g1', stmts=[ Node(id=u'n1', attrs=[ Attr(name=u'attr1', value=None), Attr(name=u'attr2', value=u'value2') ]) ]))