remove dead code

This commit is contained in:
Bastien Gérard 2018-08-18 00:03:17 +02:00
parent 36c5f02bfb
commit 1bcdcce93a
2 changed files with 2 additions and 4 deletions

View File

@ -100,13 +100,11 @@ class BaseDocument(object):
for key, value in values.iteritems(): for key, value in values.iteritems():
if key in self._fields or key == '_id': if key in self._fields or key == '_id':
setattr(self, key, value) setattr(self, key, value)
elif self._dynamic: else:
dynamic_data[key] = value dynamic_data[key] = value
else: else:
FileField = _import_class('FileField') FileField = _import_class('FileField')
for key, value in values.iteritems(): for key, value in values.iteritems():
if key == '__auto_convert':
continue
key = self._reverse_db_field_map.get(key, key) key = self._reverse_db_field_map.get(key, key)
if key in self._fields or key in ('id', 'pk', '_cls'): if key in self._fields or key in ('id', 'pk', '_cls'):
if __auto_convert and value is not None: if __auto_convert and value is not None:

View File

@ -1000,7 +1000,7 @@ class Document(BaseDocument):
class DynamicDocument(Document): class DynamicDocument(Document):
"""A Dynamic Document class allowing flexible, expandable and uncontrolled """A Dynamic Document class allowing flexible, expandable and uncontrolled
schemas. As a :class:`~mongoengine.Document` subclass, acts in the same schemas. As a :class:`~mongoengine.Document` subclass, acts in the same
way as an ordinary document but has expando style properties. Any data way as an ordinary document but has expanded style properties. Any data
passed or set against the :class:`~mongoengine.DynamicDocument` that is passed or set against the :class:`~mongoengine.DynamicDocument` that is
not a field is automatically converted into a not a field is automatically converted into a
:class:`~mongoengine.fields.DynamicField` and data can be attributed to that :class:`~mongoengine.fields.DynamicField` and data can be attributed to that