hmarr/mongoengine — pull request #487 by swashbuckler (2012-04-22 11:56:10+00:00)
Title: Fix for Issue 485: storing file-like objects

This fixes #485, whereby file-like objects were unable to be stored because the code insisted objects be instances of file.

This no longer demands FileField be an actual instance of file, but instead checks whether object has a 'read' attribute. Fixes read() on GridFSProxy to return an empty string on read failure, or None if file does not exist.