Added 'strict' meta parameter

This commit is contained in:
Axel Haustant
2015-04-13 17:49:08 +02:00
parent 19dc312128
commit cd2d9517a0
3 changed files with 115 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ class BaseDocument(object):
# Check if there are undefined fields supplied, if so raise an
# Exception.
if not self._dynamic:
if not self._dynamic and self._meta.get('strict', True):
for var in values.keys():
if var not in self._fields.keys() + ['id', 'pk', '_cls', '_text_score']:
msg = (