title: Mongoengine Serializer Error | Python | Django rest framework
body: <p>I am having trouble with serialization of "PointField" in mongoengine with django rest framework.</p>
  
  <p>Following is my Model</p>
  
  <pre><code> from mongoengine import *
   import datetime
    class Location(Document):
      user_id = StringField(required=True)
      location_title = StringField(required=False)
      location_type = StringField(required=False)
      coordinates = PointField(required=True)
      location_rating = IntField(required=True)
      reason = StringField(required=False)
      data_entry_date = DateTimeField(default=datetime.datetime.now)
  </code></pre>
  
  <p>Following is my serializer code</p>
  
  <pre><code>from rest_framework_mongoengine import serializers
  from pycoreapi.models.location import Location
  class LocationSerializer(serializers.MongoEngineModelSerializer):
  
      class Meta:
          model = Location
          depth = 3
  </code></pre>
  
  <p>and I am returning View Response from mongodb like this</p>
  
  <pre><code>filtered_objects = Location.objects(coordinates__geo_within_sphere=[[longitude, latitude], radius / 6371])
  
  serializer = LocationSerializer(filtered_objects)
  
  return serializer.data, status.HTTP_200_OK
  </code></pre>
  
  <p>Now from mongodb the filtered location list is coming fine but the Serializer is not working. </p>
  
  <p>I am getting following error </p>
  
  <p><strong>Exception Value:</strong> 'PointField' object has no attribute '_get_val_from_obj'</p>
  
  <p><strong>Exception Location:</strong> ~/python2.7/site-packages/rest_framework/fields.py in field_to_native, line 422</p>
  
  <p>Not getting any clue, please help.</p>