@raise_if_unsaved
    def get_leafnodes(self, include_self=False):
        descendants = self.get_descendants(include_self=include_self)

        return self._tree_manager._mptt_filter(
            descendants,
            left=(models.F(self._mptt_meta.right_attr) - 1)
        )
Creates a ``QuerySet`` containing leafnodes of this model
dataset/ETHPy150Open django-mptt/django-mptt/mptt/models.py/MPTTModel.get_leafnodes