📜 ⬆️ ⬇️

Data model visualization

For django there is a good utility that analyzes the description of the data model and draws its graphical representation in the graphviz dot-format.
Today I rewrote this utility under appengine .

image

The utility recognizes Expando (adds ellipsis to the attribute list),
inheritance from PolyModel (draws arrows of inheritance),
as well as reference properties (including self-made, such as ManyToManyProperty).
')
How to use:
  1. put the script in the directory with sdk
  2. run it from the application root directory, specifying with the arguments the list of modules for analysis (in the import name format):
    python path/to/modelviz.py models.foo models.bar > models.dot
  3. convert the resulting dot-file to something more convenient, for example, in png:
    dot models.dot -Tpng > models.png
  4. enjoy unearthly beauty

Source: https://habr.com/ru/post/107603/


All Articles