check for dynamic document, exclude id pk and _cls

This commit is contained in:
Rik 2013-09-03 11:25:45 +02:00 committed by Wilson Júnior
parent 4cca9f17df
commit 06064decd2

View File

@ -63,8 +63,9 @@ class BaseDocument(object):
# Check if there are undefined fields supplied, if so raise an
# Exception.
if not self._dynamic:
for var in values.keys():
if var not in self._fields.keys():
if var not in self._fields.keys() + ['id', 'pk', '_cls']:
msg = (
"The field '{}' does not exist on the document '{}'"
).format(var, self._class_name)