Django - counting 'depth' of 'select_related' to get know how many nodes has object to top object -
for example if have model class this:
class category(models.model) parent = models.manytomanyfield('self', symmetrical=false, blank=true)
and have instance of category have parent parent has albo has parent, there possibility value of children instance top category? , there possibility count somehow depth of deepest related object of of category instance?
if need trees of model instances, take @ django-mptt or django-treebeard. both provide lot of convenience.
Comments
Post a Comment