Got EmbeddedDocumentFields working

Added validation on EmbeddedDocumentField, added tests for
EmbeddedDocumentFields.
This commit is contained in:
Harry Marr 2009-11-17 01:32:40 +00:00
commit 5a87534c22
5 changed files with 46 additions and 5 deletions

View file

@ -161,3 +161,8 @@ class BaseDocument(object):
if name not in self._fields:
raise KeyError(name)
return setattr(self, name, value)
def _to_mongo(self):
"""Return data dictionary ready for use with MongoDB.
"""
return dict((k, v) for k, v in self._data.items() if v is not None)