title: django eager loading one-to-many relationships
body: <p>Simple question, I've searched and can't figure this out...</p>
  
  <p>How do I setup eager loading in django?</p>
  
  <pre><code>class Album(models.Model):
      user = models.ForeignKey(
          settings.AUTH_USER_MODEL,
          on_delete=models.CASCADE,
      )
      title = models.CharField(max_length=255)
      description = models.CharField(max_length=255, blank=True)
  
  
  class Photo(models.Model):
      album = models.ForeignKey(Album, on_delete=models.CASCADE)
      name = models.CharField(max_length=255)
      photo = models.ImageField(upload_to='photos/%Y/%m/%d/')
  
  
  albums = Album.objects.filter(user=request.user).all()    
  for album in albums:
      photos = album.photo_set.all()
      for photo in photos:
          print(photo.name)
          print(photo.photo)
  </code></pre>
  
  <p>I now want to retrieve all albums and all photos, with a single call to the DB.
  <code>albums = Album.objects.filter(user=request.user).all()</code></p>
  
  <p>I've looked at <a href="https://docs.djangoproject.com/en/2.1/ref/models/querysets/#select-related" rel="nofollow noreferrer">select_related()</a> and <a href="https://docs.djangoproject.com/en/2.1/ref/models/querysets/#prefetch-related" rel="nofollow noreferrer">prefetch_related()</a> but these looks to be for the reverse (getting the album object at the same time as the photo objects, when querying against the photo object)</p>