Fixed amibiguity and differing behaviour regarding field defaults (#349)

Now field defaults are king, unsetting or setting to None on a field
with a default means the default is reapplied.
This commit is contained in:
Ross Lawley
2013-06-06 13:31:52 +00:00
parent ea53612822
commit ad15781d8f
7 changed files with 160 additions and 33 deletions

View File

@@ -206,7 +206,7 @@ class Document(BaseDocument):
if validate:
self.validate(clean=clean)
if not write_concern:
if write_concern is None:
write_concern = {"w": 1}
doc = self.to_mongo()