title: Append in two for loop django
body: <p>I need to get albums with there related images .I have two albums in 1st loop  <strong>abc</strong> and <strong>abc123</strong> and two images in abc album  and 3 images in abc123 album but my response is returning 5 images in each album. 
  i'm not able to create proper response.  </p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Upload(models.Model):
      image=models.ImageField(upload_to='upload/', blank=True, null=True)
      user = models.ForeignKey(User, on_delete=models.CASCADE)
      # url= models.CharField(max_length=500)
      def __str__(self):
          return str(self.id)
  
  class Album(models.Model):
      name = models.CharField(max_length=128)
      user = models.ForeignKey(User, on_delete=models.CASCADE)
      def __str__(self):
          return str(self.name)
  
  class AlbumImage(models.Model):
      album = models.ForeignKey(Album, on_delete=models.CASCADE)
      image = models.ForeignKey(Upload, on_delete=models.CASCADE)
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>def getalbum(self,request):
      albums=Album.objects.filter(user=request.user)
      album={}
      image_list={}
      all_results=[]
      all_images=[]
      for a in albums:
          album_images=AlbumImage.objects.filter(album=a)
          for i in album_images:
              image_object=Upload.objects.get(id=str(i.image))
              image_list=str(image_object.image)
              all_images.append(image_list)
          album[a.name]=all_images
      all_results.append(album)
      return Response(all_results)
  </code></pre>
  
  <p><strong>response</strong>  </p>
  
  <pre><code>[
      {
          "abc": [
              "upload/images_aPWBEcp.jpeg",
              "upload/images.jpeg",
              "upload/ic_id_card_placeholder_N0x2KP9.png",
              "upload/images_jocZcBu.jpeg",
              "upload/ic_id_card_placeholder_N0x2KP9.png"
          ],
          "abc123": [
              "upload/images_aPWBEcp.jpeg",
              "upload/images.jpeg",
              "upload/ic_id_card_placeholder_N0x2KP9.png",
              "upload/images_jocZcBu.jpeg",
              "upload/ic_id_card_placeholder_N0x2KP9.png"
          ]
      }
  ]
  </code></pre>
  
  <p><strong>abc</strong> album</p>
  
  <p>upload/images_aPWBEcp.jpeg</p>
  
  <p>upload/images.jpeg</p>
  
  <p><strong>abc123</strong> album </p>
  
  <p>upload/ic_id_card_placeholder_N0x2KP9.png</p>
  
  <p>upload/images_jocZcBu.jpeg</p>
  
  <p>upload/ic_id_card_placeholder_N0x2KP9.png</p>