title: How can one customize Django Rest Framework serializers output?
body: <p>I have a Django model that is like this:</p>
  
  <pre><code>class WindowsMacAddress(models.Model):
      address = models.TextField(unique=True)
      mapping = models.ForeignKey('imaging.WindowsMapping', related_name='macAddresses')
  </code></pre>
  
  <p>And two serializers, defined as:</p>
  
  <pre><code>class WindowsFlatMacAddressSerializer(serializers.Serializer):
      address = serializers.Field()
  
  class WindowsCompleteMappingSerializer(serializers.Serializer):
      id = serializers.Field()
      macAddresses = WindowsFlatMacAddressSerializer(many=True)
      clientId = serializers.Field()
  </code></pre>
  
  <p>When accessing the serializer over a view, I get the following output:</p>
  
  <pre><code>[
      {
          "id": 1, 
          "macAddresses": [
              {
                  "address": "aa:aa:aa:aa:aa:aa"
              }, 
              {
                  "address": "bb:bb:bb:bb:bb:bb"
              }
          ], 
          "clientId": null
      }
  ]
  </code></pre>
  
  <p>Almost good, except that I'd prefer to have:</p>
  
  <pre><code>[
      {
          "id": 1, 
          "macAddresses": [
              "aa:aa:aa:aa:aa:aa",
              "bb:bb:bb:bb:bb:bb"
          ],
          "clientId": null
      }
  ]
  </code></pre>
  
  <p>How can I achieve that ?</p>