MyModel.objects.filter(id__in=[my_model.id for my_model in MyModel.objects.all() if my_model.is_leaf_node()])
Haikson
[ Everything is possible. Everything takes time. ]
MyModel.objects.filter(id__in=[my_model.id for my_model in MyModel.objects.all() if my_model.is_leaf_node()])