check for dynamic document, exclude id pk and _cls
This commit is contained in:
@@ -63,8 +63,9 @@ class BaseDocument(object):
|
|||||||
|
|
||||||
# Check if there are undefined fields supplied, if so raise an
|
# Check if there are undefined fields supplied, if so raise an
|
||||||
# Exception.
|
# Exception.
|
||||||
|
if not self._dynamic:
|
||||||
for var in values.keys():
|
for var in values.keys():
|
||||||
if var not in self._fields.keys():
|
if var not in self._fields.keys() + ['id', 'pk', '_cls']:
|
||||||
msg = (
|
msg = (
|
||||||
"The field '{}' does not exist on the document '{}'"
|
"The field '{}' does not exist on the document '{}'"
|
||||||
).format(var, self._class_name)
|
).format(var, self._class_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user