I had the same thing happen to me and this was the only post I found on the 
internet that mentions it.

Note to other people who have this problem: 

*Be careful passing instances of model objects into celery tasks since they 
get pickled and your FileField fields will probably be removed via pickling.
*

The reason this is a problem is because of the way ImageField (and I assume 
FileFields) work.  When there is no File object associated with the 
FileField (its set to None) and you call instance.filefieldname on the 
instance it will return "None" and be == to "None" even though the field 
exists (without a file).  Since the field 'appears' to be not set (it 
evaluates to None) i don't think pickle is adding it to the serialized 
version of the instance, so when you de-serialize (in the celery task, or 
wherever) the field does not exist  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/yWZIu_p8BEgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to