예제 #1
0
 def test_to_sql(self):
     doc = self.registry.Documentation()
     doc.auto_doc()
     format_ = Configuration.get('schema_format')
     dot = SQLSchema('test', format=format_)
     doc.toSQL(dot)
     dot.save()
예제 #2
0
 def test_to_sql(self):
     doc = self.registry.Documentation()
     doc.auto_doc()
     format_ = Configuration.get('schema_format')
     dot = SQLSchema('test', format=format_)
     doc.toSQL(dot)
     dot.save()
예제 #3
0
 def test_one_table_with_foreign_key_on_label(self):
     dot = SQLSchema('My table model')
     table = dot.add_label('My table')
     table.add_column('My column', 'Integer', primary_key=True)
     table2 = dot.add_table('A 2nd table')
     table2.add_foreign_key('My fk', table, nullable=False)
     dot.render()
예제 #4
0
 def test_to_sql(self, rollback_registry):
     registry = rollback_registry
     doc = registry.Documentation()
     doc.auto_doc()
     format_ = Configuration.get('schema_format')
     dot = SQLSchema('test', format=format_)
     doc.toSQL(dot)
     dot.save()
예제 #5
0
 def test_one_table_with_foreign_key_on_label(self):
     dot = SQLSchema('My table model')
     table = dot.add_label('My table')
     table.add_column('My column', 'Integer', primary_key=True)
     table2 = dot.add_table('A 2nd table')
     table2.add_foreign_key('My fk', table, nullable=False)
     dot.render()
예제 #6
0
파일: scripts.py 프로젝트: AnyBlok/AnyBlok
def anyblok2doc():
    """Return auto documentation for the registry
    """
    anyblok_registry = anyblok.start('autodoc')
    if anyblok_registry:
        anyblok_registry.commit()
        doc = anyblok_registry.Documentation()
        doc.auto_doc()
        if Configuration.get('doc_format') == 'RST':
            with open(Configuration.get('doc_output'), 'w') as fp:
                doc.toRST(fp)
        elif Configuration.get('doc_format') == 'UML':
            format_ = Configuration.get('schema_format')
            name_ = Configuration.get('schema_output')
            dot = ModelSchema(name_, format=format_)
            doc.toUML(dot)
            dot.save()
        elif Configuration.get('doc_format') == 'SQL':
            format_ = Configuration.get('schema_format')
            name_ = Configuration.get('schema_output')
            dot = SQLSchema(name_, format=format_)
            doc.toSQL(dot)
            dot.save()
예제 #7
0
 def test_get_table_with_label(self):
     dot = SQLSchema('My UML model')
     table = dot.add_label('My table')
     self.assertEqual(dot.get_table('My table'), table)
예제 #8
0
 def test_one_table_with_column(self):
     dot = SQLSchema('My table model')
     table = dot.add_table('My table')
     table.add_column('My column', 'Integer', primary_key=True)
     dot.render()
예제 #9
0
 def test_one_label(self):
     dot = SQLSchema('My table model')
     dot.add_table('My table')
     dot.render()
예제 #10
0
 def test_get_table_with_label(self):
     dot = SQLSchema('My UML model')
     table = dot.add_label('My table')
     assert dot.get_table('My table') == table
예제 #11
0
 def test_get_table_with_label(self):
     dot = SQLSchema('My UML model')
     table = dot.add_label('My table')
     self.assertEqual(dot.get_table('My table'), table)
예제 #12
0
 def test_one_table_with_column(self):
     dot = SQLSchema('My table model')
     table = dot.add_table('My table')
     table.add_column('My column', 'Integer', primary_key=True)
     dot.render()
예제 #13
0
 def test_one_label(self):
     dot = SQLSchema('My table model')
     dot.add_table('My table')
     dot.render()