#NEWLINE# @ classmethod #NEWLINE# def get_annotated_list( cls , parent = None , max_depth = None ) : #NEWLINE# #INDENT# '\n        Gets an annotated list from a tree branch.\n\n        :param parent:\n\n            The node whose descendants will be annotated. The node itself\n            will be included in the list. If not given, the entire tree\n            will be annotated.\n\n        :param max_depth:\n\n            Optionally limit to specified depth\n        ' #NEWLINE# ( result , info ) = ( [ ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# ( start_depth , prev_depth ) = ( None , None ) #NEWLINE# qs = cls . get_tree ( parent ) #NEWLINE# if max_depth : #NEWLINE# #INDENT# qs = qs . filter ( depth__lte = max_depth ) #NEWLINE# #UNINDENT# return cls . get_annotated_list_qs ( qs )