[Fixed]-Django – initialize many to many fields on database level

1👍

It’s a view. Django is explicitly not MVC.

But yes, there is a well-documented prefetch_related method:

xes = X.objects.filter(iscool=True).prefetch_related('someField')

Leave a comment