code: def to_representation(self, obj):
          
          value = self.model_field.__get__(obj, None)
          return smart_text(value, strings_only=True)
docs: convert value to representation.
  
          DRF ModelField uses ``value_to_string`` for this purpose. Mongoengine fields do not have such method.
  
          This implementation uses ``django.utils.encoding.smart_text`` to convert everything to text, while keeping json-safe types intact.
  
          NB: The argument is whole object, instead of attribute value. This is upstream feature.
          Probably because the field can be represented by a complicated method with nontrivial way to extract data.