umutbozkurt/django-rest-framework-mongoengine — pull request #44 by PeRDy (2014-11-20 18:11:17+00:00)
Title: Add DBRef case in transform_object

When I tried to serialize an object with ReferenceField I found that these fields couldn't be serialized because transform_object method wasn't expect DBRef objects. The solution was check if the object is an instance of DBRef and, if affirmative, call transform_object with obj.id (an ObjectId instance). The object is now serialized successfully.