This doesn't quite look right. I think it will use the scope of the last country in the countries queryset? Also, I think the scope variable is not defined if there are no countries in the project.countries.all() queryset? (might be impossible but I felt it was worth noting)