Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Acyclic graph in Django

I would like to achieve acyclic graph structure in Django. For example I have some categories in tree structure:

Guitars
- Classical Guitars
- Western Guitars
- Guitars for Children

Ukuleles
- Soprano Ukulele
- Concert Ukulele
- Baryton Ukulele
- Ukuleles for Children

Now I would like to add category For Children and create link to existing categories Guitars for Children and Ukuleles for Children. But I have to avoid cycles in this graph.

What is the easiest way to achieve it? Is possible to use django-mptt? I need it dynamic and easy modifiable in administration. You can image it like categories structure in complex eshop.

like image 624
Tom Tichý Avatar asked Jun 26 '13 10:06

Tom Tichý


1 Answers

You can try django-dag. I don't have much experience with it, but it could fit.

like image 80
yetty Avatar answered Sep 25 '22 00:09

yetty