def children(self): children_list = {} level_one = Member.objects.filter(parent=self) if level_one.count()>0 : for child in level_one: children = self.__children_of_child(child) children_list[child.id] = children def __children_of_child(self, parent): children_list = {} children = Member.objects.filter(parent=parent) if children.count()>0: for child in children: children_list[child.id] = self.__children_of_child(child) return children_list
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)