Version 25 (modified by QingFeng, 11 years ago) (diff)

Django Trunk GenericRelation Modify

Converting Django models into Graphviz DOT files

Inspired by 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

View online or 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.)


MC Minerali Ceramici

mincer example


Once you use this python script to generate the dot file (, ensure you have dot installed (part of Graphviz), and issue:

dot -Tpng -o app.png

Other References

You might also be interested in this Django app by Andrew Barilla from which I borrowed some ideas, that displays the graphviz results directly from the web.


Django Trunk GenericRelation->

   from django.db.models.fields.generic import GenericRelation
except ImportError:
   from django.contrib.contenttypes.generic import GenericRelation

Please direct all feedback to Antonio Cavedoni.

Attachments (12)

Download all attachments as: .zip

Back to Top