code: def to_representation(self, obj):
          
          many = isinstance(obj, collections.Iterable) \
              or isinstance(obj, models.Manager) \
              and not isinstance(obj, dict)
  
          assert self.serializer is not None \
              and issubclass(self.serializer, serializers.ModelSerializer), (
                  "Bad serializer defined %s" % self.serializer
              )
  
          extra_params = {}
          if issubclass(self.serializer, ModelPermissionsSerializer):
              extra_params['cached_allowed_fields'] =\
                  self.parent.cached_allowed_fields
  
          ser = self.serializer(obj, context=self.context, many=many,
                                **extra_params)
          return ser.data
docs: Represent data for the field.