def get_descendant_count(self):
    return (getattr(self, self._meta.right_attr) -
            getattr(self, self._meta.left_attr) - 1) / 2
Returns the number of descendants this model instance has.
dataset/ETHPy150Open agiliq/django-socialnews/socialnews/mptt/models.py/get_descendant_count