Got EmbeddedDocumentFields working
Added validation on EmbeddedDocumentField, added tests for EmbeddedDocumentFields.
This commit is contained in:
parent
48418d5a60
commit
5a87534c22
5 changed files with 46 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue