From a3f5f8e308c2ff23a22ab0455a064a54f5557c91 Mon Sep 17 00:00:00 2001 From: jaysw Date: Mon, 4 Feb 2013 12:49:53 +1000 Subject: [PATCH] Don't exclude null values from dynamic properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When creating a document with 'dynamic properties', if a null value is used, then the property is excluded from the document. e.g.     Document(dict(a=None, b=None)).to_json() Is there a reason for this that I'm missing? --- couchdbkit/schema/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/couchdbkit/schema/base.py b/couchdbkit/schema/base.py index 0ef64f5..f36b537 100644 --- a/couchdbkit/schema/base.py +++ b/couchdbkit/schema/base.py @@ -117,8 +117,7 @@ def __init__(self, _d=None, **properties): _dynamic_properties = properties.copy() for attr_name, value in _dynamic_properties.iteritems(): - if attr_name not in self._properties \ - and value is not None: + if attr_name not in self._properties: if isinstance(value, p.Property): value.__property_config__(self, attr_name) value.__property_init__(self, value.default_value())