Fixed pickle unsaved document regression (#327)

This commit is contained in:
Ross Lawley 2013-05-21 07:07:17 +00:00
parent fd11244966
commit 9aa77bb3c9
2 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,10 @@
Changelog
=========
Changes in 0.8.1
================
- Fixed pickle unsaved document regression (#327)
Changes in 0.8.0
================
- Fixed querying ReferenceField custom_id (#317)

View File

@ -143,7 +143,8 @@ class BaseDocument(object):
def __getstate__(self):
data = {}
for k in ('_changed_fields', '_initialised', '_created'):
data[k] = getattr(self, k)
if hasattr(self, k):
data[k] = getattr(self, k)
data['_data'] = self.to_mongo()
return data