'The "depth" argument to select_related() will stop the descent at a
particular level. This can be used on lists as well.'

def test_list_with_depth(self):

    def test():
        world = Species.objects.all().select_related(depth=2)
        orders = [o.genus.family.order.name for o in world]
        self.assertEqual(sorted(orders), ['Agaricales', 'Diptera', 'Fabales', 'Primates'])
    self.assertNumQueries(5, test)
