| os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings") |
| from django.db.models.fields.related import ForeignKey |
| from core.models import * |
| if type(c)==type(PlCoreBase): |
| class_names.append(c.__name__) |
| print "digraph plstack {"; |
| if type(f)==ForeignKey and f.name.title() in class_names: |
| print '\t"%s"->"%s";'%(c.__name__,f.name.title()) |
| if type(f)==ForeignKey and f.name.title() in class_names: |
| d[c.__name__].append(f.name.title()) |
| d[c.__name__]=[f.name.title()] |
| print json.dumps(d,indent=4) |