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:
@@ -348,7 +348,7 @@ class QuerySet(object):
|
||||
"""
|
||||
Document = _import_class('Document')
|
||||
|
||||
if not write_concern:
|
||||
if write_concern is None:
|
||||
write_concern = {}
|
||||
|
||||
docs = doc_or_docs
|
||||
@@ -424,7 +424,7 @@ class QuerySet(object):
|
||||
queryset = self.clone()
|
||||
doc = queryset._document
|
||||
|
||||
if not write_concern:
|
||||
if write_concern is None:
|
||||
write_concern = {}
|
||||
|
||||
# Handle deletes where skips or limits have been applied or
|
||||
@@ -490,7 +490,7 @@ class QuerySet(object):
|
||||
if not update and not upsert:
|
||||
raise OperationError("No update parameters, would remove data")
|
||||
|
||||
if not write_concern:
|
||||
if write_concern is None:
|
||||
write_concern = {}
|
||||
|
||||
queryset = self.clone()
|
||||
|
||||
Reference in New Issue
Block a user