Optimized django queryset use