<p>You can pass a queryset to prefetch_related (and select_related): <code>Restaurant.objects.prefetch_related(Prefetch('pizzas__toppings'))</code> #django.db.models.Prefetch</p>
By clicking “Accept all”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage and assist in our marketing efforts. Check our privacy policies.