MongoEngine/mongoengine — pull request #342 by wojcikstefan (2013-05-27 20:49:52+00:00)
Title: Fix for pickle.loads

`pickle.loads` fails on documents that without any changed fields:

```
body = pickle.loads(base64.b64decode(task['body']))
File "/usr/lib/python2.7/pickle.py", line 1382, in loads
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 858, in load
dispatch[key](self)
File "/usr/lib/python2.7/pickle.py", line 1217, in load_build
setstate(state)
File "/home/ubuntu/closeio/venv/src/mongoengine/mongoengine/base/document.py", line 155, in __setstate__
setattr(self, k, data[k])
KeyError: '_changed_fields'
```

This PR fixes it.