I have a very simple datamodel with a one to many relationship between video and comments
class Video(models.Model):
url = models.URLField(unique=True)
.
What you need to do is use the select_related on the Comment.
Lets say you need to find the all the videos whose title starts with 'The' and the comments related to it
comments = Comment.objects.filter(video__title__starts_with='The')
.select_related('video').all()
This will load all the comments and the appropriate Video object for that comment. You will still need to pivot over the Video to iterate over the videos. Use the python itertools.groupby function to do that pivoting in memory.