= Converting Django models into Graphviz DOT files =
Inspired by [http://www.hackdiary.com/archives/000093.html this nice hack by Matt Biddulph], this is a Python script that generates a Graphviz DOT file for quick visualizations of Django model definitions.
== Source code ==
[http://unicoders.org/code/django/trunk/utils/modelviz.py View online] or [http://code.unicoders.org/django/trunk/utils/modelviz.py download from Subversion repository] (you could also set it as a svn:external on your repository to keep up to date with the latest revisons.)
== Examples ==
=== [http://www.mincer.it/ MC Minerali Ceramici] ===
{{{
#!html
}}}
== Command ==
Once you use this python script to generate the dot file ({{{app.dot}}}), ensure you have {{{dot}}} installed (part of Graphviz), and issue:
{{{
dot app.dot -Tpng -o app.png
}}}
== Other References ==
You might also be interested in [http://www.exit66.com/diagram.zip this Django app by Andrew Barilla ] from which I borrowed some ideas, that displays the graphviz results directly from the web.
== Feedback ==
Django Trunk GenericRelation->
{{{
try:
from django.db.models.fields.generic import GenericRelation
except ImportError:
from django.contrib.contenttypes.generic import GenericRelation
}}}
Please direct all feedback to [http://cavedoni.com/ Antonio Cavedoni].