def depth_first_order(self):
        if hasattr(self, '_children'):
            ret = [self]
            for child in self.get_children():
                ret.extend(child.depth_first_order())
            return ret
        else:
            return [self] + list(self.get_descendants().order_by('path'))
All of the nodes in my tree (including myself) in depth-first order.
dataset/ETHPy150Open fusionbox/django-widgy/widgy/models/base.py/Node.depth_first_order