wpjunior/django-mongotools — Issue #6: filefield doesn't work
Author: mgom
Created: 2011-12-01 09:39:36+00:00
State: open

Hi

it seems that filefield doesn't work, i mean when i use such a field, it can't save in gridfs ?
is it normal ?

traces are :

Exception Type:	AttributeError
Exception Value:	'InMemoryUploadedFile' object has no attribute 'grid_id'

/virtual-env/lib/python2.7/site-packages/mongoengine/fields.py in validate
return None
def to_python(self, value):
if value is not None:
return GridFSProxy(value)
def validate(self, value):
if value.grid_id is not None: # HERE THE ISSUE
assert isinstance(value, GridFSProxy)
assert isinstance(value.grid_id, pymongo.objectid.ObjectId)