title: Django Rest Framework RelatedField can't return a dict object
body: <p>I have a serializer and I want to use a <code>serializers.RelatedField</code> so I can manipulate the content of one of the fields of the serializer. I want that field to nest a couple fields from a related table.</p>
  
  <p>This is my serializer and the <code>serializer.RelatedField</code>. I want the 'city' field to return a nested object with the 'id' and the 'name' of the related city:</p>
  
  <pre><code>class CityRelatedField(serializers.RelatedField):
      def to_representation(self, value):
          city = {
              'id': value.id,
              'name': value.name
          }
  
          return city
  
  class AirportSerializer(serializers.ModelSerializer):
      city = CityRelatedField(queryset=models.City.objects.all())
  
      class Meta:
          model = models.Airport
          fields = ('id', 'city', 'name', 'iata')
  </code></pre>
  
  <p>This is the error I get: <code>TypeError: unhashable type: 'dict'</code></p>
  
  <p>Thanks for your help.</p>