1👍
✅
This is the easy and efficient way:
users = ( User
.objects
.filter( email__attachment__name = 'Picture1.jpg' )
.distinct()
)
Remember to create needed indexes to your database tables.
Source:stackexchange.com