Graphical representation of any mptt model.
pip install django-mptt-graph
Add "mptt_graph",
to installed apps, make migrations and migrate
Urls: url('^graph/', include('mptt_graph.urls')),
Go to the admin and make a Graph model object:
In Model path
put the path to the model: myapp.models.MyModel
In Root node primary key
put the primary key of the node you wish to start from
Go to /graph/
Example: /graph/myapp.models.MyModel/1/
First url parameter is the path to the model and second is the root node primary key
Make a view that sends a nodes
context variable to /templates/mptt_graph/tree.html
or use the inline template:
{% include "mptt_graph/tree_inline.html" %}