title: In Django Rest Framework, how do I serialize values to an arraylist?
body: <p>In Django Rest Framework 3.0+,I want get this value:</p>
  
  <pre><code>{
    image:[img1,img2,img3]
  }
  </code></pre>
  
  <p>and my code like:</p>
  
  <p>models.py</p>
  
  <pre><code>class UserDynamic(models.Model):
  
      """User dynamic"""
      user = models.ForeignKey(settings.AUTH_USER_MODEL)
      content = models.TextField(max_length=200)
      createtime = models.DateTimeField(auto_now_add=True)
  
  
  class UserDynamicImage(models.Model):
  
      """User dynamic images"""
      userdynamic = models.ForeignKey(UserDynamic)
      image = models.ImageField(upload_to='UserDynamicImage/')
  </code></pre>
  
  <p>serializers.py</p>
  
  <pre><code>class UserDynamicImageSerializer(serializers.ModelSerializer):  
      def to_representation(self, obj):
          return obj.image
  
  class UserDynamicSerializer(serializers.ModelSerializer):
  
      user = UserProfileSerializer()
      imgs = serializers.SerializerMethodField('GetImage')
      # imgs = serializers.ListField(img = serializers.ImageField())
      # imgs = UserDynamicImageSerializer(many=True, read_only=True)
  
      class Meta:
          model = UserDynamic
          fields = ('id', 'user', 'content', 'imgs', 'createtime')
  
      def GetImage(self,UserDynamic):
          entity = UserDynamicImage.objects.filter(userdynamic = UserDynamic)
          return UserDynamicImageSerializer(entity,many=True,context={"request": self.context['request']}).data
  </code></pre>
  
  <p>Right now，it return a error:
   is not JSON serializable</p>