#NEWLINE# @ raise_if_unsaved #NEWLINE# def is_descendant_of( self , other , include_self = False ) : #NEWLINE# #INDENT# '\n        Returns ``True`` if this model is a descendant of the given node,\n        ``False`` otherwise.\n        If include_self is True, also returns True if the two nodes are the same node.\n        ' #NEWLINE# opts = self . _mptt_meta #NEWLINE# if ( include_self and ( other . pk == self . pk ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if ( getattr ( self , opts . tree_id_attr ) != getattr ( other , opts . tree_id_attr ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# left = getattr ( self , opts . left_attr ) #NEWLINE# right = getattr ( self , opts . right_attr ) #NEWLINE# return ( ( left > getattr ( other , opts . left_attr ) ) and ( right < getattr ( other , opts . right_attr ) ) )