equal
deleted
inserted
replaced
1 from iro.model import schema |
1 from iro.model import schema |
2 |
2 |
3 from sqlalchemy.orm import class_mapper |
3 tables = schema.Base.metadata.sorted_tables |
4 tables = [] |
4 |
5 for attr in schema.__tables__: |
5 tables_cls={} |
6 if attr[0] == '_': continue |
6 for i in dir(schema): |
|
7 if i.startswith("__") or i == "Base": |
|
8 continue |
7 try: |
9 try: |
8 cls = getattr(schema, attr) |
10 a = getattr(schema,i) |
9 tables.append(class_mapper(cls)) |
11 tables_cls[a.__tablename__] = a |
10 except: |
12 except AttributeError: |
11 pass |
13 pass |
12 |
14 |
13 |
15 |
14 #schema plot |
16 #schema plot |
15 def createSchemaPlot(fname): |
17 def createSchemaPlot(fname): |