Let’s consider a Course Structure for a Learning Management System (call it an online school).
We have something like this :
Course 1
Topic 1
Sub-Topic 1-1
sub-Topic 1-2
Topic 2
Sub-Topic 2-1
Sub-Topic 2-2
Course 2
Topic 1
Sub-Topic 1-1
sub-Topic 1-2
Topic 2
Sub-Topic 2-1
Sub-Topic 2-2
...
For example, we have a course of “Mathematics 1”, Topic of “Linear Algebra”, and Sub-topic of “Linear equations”.
The important point is that we can assign some Content and some Tests to each of these nodes.
Now django-mptt comes out:
1) I need to populate the course tree within the navigation bar. I guess that should be easy and trivial. what’s your idea ?
2) Maybe I want to point a Test to both Sub-Topic 1-1 in Course 1 AND Sub-Topic 2-2 in course 2. Doesn’t it ruin the theory of trees? Well, they are not part of the tree, I believe.. They just point to some nodes. What do you think ?
Thanks for your answers beforehand ..
Can only answer to point 2 sorry.
Regarding the theory, what you are describing is not tree but a DAG (Directed Acyclic Graph) which is not a tree anymore.
Yet lots of CMS built on top of django-mptt solve this problem that way (thanks to django-mptt ability to deal with a forest not just a single tree):
This is very much like a symbolic link on a file system.
You could then do everything in one tree:
Or using several trees: