I suspect your usage of `distinct('path')` is causing issues during
prefetching here
as it will prevent different File with the same .path from being prefetched
for two different
folder objects.
You likely want to use `distinct('path', 'folder')` here instead where
'folder' might have a differe
Assume these two models.
class Folder(model):
name = models.CharField(max_length=8)
files = models.ManyToManyField('File')
class File:
path = models.CharField(max_length=255)
First I was fetching the folders and while looping over them fetching the
files with a distinct path
folders
2 matches
Mail list logo